14770 {
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19971 {
19972 if (Main.netMode != 1)
19973 {
19974 for (int i = 0; i < 255; i++)
19975 {
19976 if (Main.player[i].active && Main.player[i].talkNPC ==
whoAmI)
19977 {
19979 {
19981 }
19983 {
19985 }
19987 {
19989 }
19991 {
19993 }
19995 {
19997 }
19999 {
20001 }
20003 {
20005 }
20006 }
20007 }
20008 }
20010 {
20013 }
20015 {
20016 if (
wet || Main.tile[(
int)(
base.Center.X / 16
f), (
int)(
position.Y - 4
f) / 16].liquid > 0)
20017 {
20018 velocity.Y = -0.4f;
20020 if (
base.Center.X / 16
f > (
float)(Main.maxTilesX / 2))
20021 {
20023 }
20026 int j = (int)
base.Center.Y / 16;
20029 {
20031 {
20033 {
20035 }
20036 }
20037 }
20038 else
20039 {
20041 {
20043 {
20045 }
20046 }
20047 }
20049 {
20051 }
20053 {
20054 velocity.X *= 0.99f;
20056 {
20058 }
20059 return;
20060 }
20061 velocity.X += (float)
num * 0.01
f;
20063 {
20064 velocity.X *= 0.95f;
20065 }
20067 {
20068 velocity.X *= 0.95f;
20069 }
20070 }
20071 else
20072 {
20073 velocity.X *= 0.93f;
20074 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
20075 {
20077 }
20078 }
20079 }
20080 else
20081 {
20082 velocity.X *= 0.93f;
20083 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
20084 {
20086 }
20087 }
20088 return;
20089 }
20091 {
20093 return;
20094 }
20096 {
20098 return;
20099 }
20101 {
20103 return;
20104 }
20107 {
20109 if (Main.expertMode && (
double)
life < (
double)
lifeMax * 0.12)
20110 {
20112 }
20114 if (Main.expertMode && (
double)
life < (
double)
lifeMax * 0.04)
20115 {
20117 }
20120 {
20122 }
20124 {
20126 }
20127 bool dead = Main.player[
target].dead;
20128 float num1051 = position.X + (float)(
width / 2) - Main.player[
target].position.X - (float)(Main.player[
target].width / 2);
20129 float num1162 = position.Y + (float)
height - 59
f - Main.player[
target].position.Y - (
float)(Main.player[
target].height / 2);
20132 {
20134 }
20135 else if ((
double)
num1273 > 6.283)
20136 {
20138 }
20140 if (this.
ai[0] == 0
f && this.
ai[1] == 0
f)
20141 {
20143 }
20144 if (this.
ai[0] == 0
f && this.
ai[1] == 2
f && this.
ai[2] > 40
f)
20145 {
20147 }
20148 if (this.
ai[0] == 3
f && this.
ai[1] == 0
f)
20149 {
20151 }
20152 if (this.
ai[0] == 3
f && this.
ai[1] == 2
f && this.
ai[2] > 40
f)
20153 {
20155 }
20156 if (this.
ai[0] == 3
f && this.
ai[1] == 4
f && this.
ai[2] > num940)
20157 {
20159 }
20160 if (this.
ai[0] == 3
f && this.
ai[1] == 5
f)
20161 {
20163 }
20164 if (Main.expertMode)
20165 {
20167 }
20168 if (
flag35 && Main.expertMode)
20169 {
20171 }
20173 {
20175 {
20177 }
20178 else
20179 {
20181 }
20182 }
20184 {
20186 {
20188 }
20189 else
20190 {
20192 }
20193 }
20195 {
20197 }
20199 {
20201 }
20202 else if ((
double)
rotation > 6.283)
20203 {
20205 }
20207 {
20209 }
20210 if (Main.rand.Next(5) == 0)
20211 {
20218 Main.dust[
num1495].velocity.X *= 0.5f;
20219 Main.dust[
num1495].velocity.Y *= 0.1f;
20220 }
20222 if (Main.IsItDay() || dead)
20223 {
20224 velocity.Y -= 0.04f;
20226 return;
20227 }
20228 if (this.
ai[0] == 0
f)
20229 {
20230 if (this.
ai[1] == 0
f)
20231 {
20234 if (Main.expertMode)
20235 {
20238 }
20239 if (Main.getGoodWorld)
20240 {
20243 }
20244 Vector2
vector =
default(Vector2);
20254 {
20257 {
20259 }
20260 }
20262 {
20265 {
20267 }
20268 }
20270 {
20273 {
20275 }
20276 }
20278 {
20281 {
20283 }
20284 }
20287 if (Main.expertMode)
20288 {
20290 }
20291 if (this.
ai[2] >= num668)
20292 {
20298 }
20300 {
20301 if (!Main.player[
target].dead)
20302 {
20304 }
20306 if (Main.expertMode)
20307 {
20309 }
20310 if (Main.getGoodWorld)
20311 {
20313 }
20314 if (this.
ai[3] >= num685)
20315 {
20319 if (Main.expertMode)
20320 {
20322 }
20331 vector112.X += vector223.X * 10
f;
20332 vector112.Y += vector223.Y * 10
f;
20333 if (Main.netMode != 1)
20334 {
20338 if (Main.netMode == 2 &&
num741 < 200)
20339 {
20340 NetMessage.SendData(23, -1, -1,
null,
num741);
20341 }
20342 }
20344 for (
int m = 0;
m < 10;
m++)
20345 {
20347 float speedX3 = vector223.X * 0.4f;
20348 float speedY2 = vector223.Y * 0.4f;
20351 }
20352 }
20353 }
20354 }
20355 else if (this.
ai[1] == 1f)
20356 {
20359 if (Main.expertMode)
20360 {
20362 }
20363 if (Main.getGoodWorld)
20364 {
20366 }
20378 {
20380 }
20381 }
20382 else if (this.
ai[1] == 2f)
20383 {
20385 if (this.
ai[2] >= 40f)
20386 {
20388 if (Main.expertMode)
20389 {
20391 }
20392 if (Main.getGoodWorld)
20393 {
20395 }
20396 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
20397 {
20399 }
20400 if ((
double)velocity.Y > -0.1 && (double)
velocity.Y < 0.1)
20401 {
20403 }
20404 }
20405 else
20406 {
20408 }
20410 if (Main.expertMode)
20411 {
20413 }
20414 if (Main.getGoodWorld)
20415 {
20417 }
20418 if (this.
ai[2] >= (
float)num796)
20419 {
20424 if (this.
ai[3] >= 3f)
20425 {
20428 }
20429 else
20430 {
20432 }
20433 }
20434 }
20436 if (Main.expertMode)
20437 {
20439 }
20441 {
20448 {
20450 }
20451 }
20452 return;
20453 }
20454 if (this.
ai[0] == 1f || this.
ai[0] == 2f)
20455 {
20456 if (this.
ai[0] == 1f || this.
ai[3] == 1f)
20457 {
20458 this.
ai[2] += 0.005f;
20459 if ((
double)this.
ai[2] > 0.5)
20460 {
20462 }
20463 }
20464 else
20465 {
20466 this.
ai[2] -= 0.005f;
20467 if (this.
ai[2] < 0f)
20468 {
20470 }
20471 }
20474 if (Main.getGoodWorld)
20475 {
20477 }
20480 {
20482 }
20483 if (Main.expertMode &&
this.ai[1] % (
float)
num818 == 0
f)
20484 {
20488 float num841 = Main.rand.Next(-200, 200);
20489 float num852 = Main.rand.Next(-200, 200);
20490 if (Main.getGoodWorld)
20491 {
20494 }
20501 vector274.X += vector285.X * 10
f;
20502 vector274.Y += vector285.Y * 10
f;
20503 if (Main.netMode != 1)
20504 {
20508 if (Main.netMode == 2 &&
num874 < 200)
20509 {
20510 NetMessage.SendData(23, -1, -1,
null,
num874);
20511 }
20512 }
20513 for (
int n = 0;
n < 10;
n++)
20514 {
20516 float speedX4 = vector285.X * 0.4f;
20517 float speedY3 = vector285.Y * 0.4f;
20520 }
20521 }
20522 if (this.
ai[1] >= 100f)
20523 {
20524 if (this.
ai[3] == 1f)
20525 {
20528 }
20529 else
20530 {
20533 if (this.
ai[0] == 3f)
20534 {
20536 }
20537 else
20538 {
20541 {
20542 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f), 8);
20543 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f), 7);
20544 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f), 6);
20545 }
20547 {
20551 float speedX5 = (float)Main.rand.Next(-30, 31) * 0.2f;
20552 float speedY4 = (float)Main.rand.Next(-30, 31) * 0.2f;
20555 }
20557 }
20558 }
20559 }
20563 float speedX6 = (float)Main.rand.Next(-30, 31) * 0.2f;
20564 float speedY5 = (float)Main.rand.Next(-30, 31) * 0.2f;
20567 velocity.X *= 0.98f;
20568 velocity.Y *= 0.98f;
20569 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
20570 {
20572 }
20573 if ((
double)velocity.Y > -0.1 && (double)
velocity.Y < 0.1)
20574 {
20576 }
20577 return;
20578 }
20582 if (Main.expertMode)
20583 {
20585 {
20587 }
20589 {
20592 }
20593 }
20597 {
20599 }
20600 if (this.
ai[1] == 0f)
20601 {
20609 if (
num974 > 400
f && Main.expertMode)
20610 {
20614 {
20618 {
20621 }
20622 }
20623 }
20624 if (Main.getGoodWorld)
20625 {
20628 }
20633 {
20636 {
20638 }
20639 }
20641 {
20644 {
20646 }
20647 }
20649 {
20652 {
20654 }
20655 }
20657 {
20660 {
20662 }
20663 }
20665 if (this.
ai[2] >= 200f)
20666 {
20670 if (Main.expertMode && (
double)
life < (double)
lifeMax * 0.35)
20671 {
20673 }
20676 }
20677 if (Main.expertMode &&
flag35)
20678 {
20683 this.
ai[3] -= 1000f;
20684 }
20685 }
20686 else if (this.
ai[1] == 1f)
20687 {
20691 if (Main.expertMode &&
this.ai[3] == 1
f)
20692 {
20694 }
20695 if (Main.expertMode &&
this.ai[3] == 2
f)
20696 {
20698 }
20699 if (Main.getGoodWorld)
20700 {
20702 }
20714 {
20716 }
20717 }
20718 else if (this.
ai[1] == 2f)
20719 {
20722 if (Main.expertMode)
20723 {
20725 }
20726 if (this.
ai[2] >= num1029)
20727 {
20729 if (Main.expertMode)
20730 {
20732 }
20733 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
20734 {
20736 }
20737 if ((
double)velocity.Y > -0.1 && (double)
velocity.Y < 0.1)
20738 {
20740 }
20741 }
20742 else
20743 {
20745 }
20747 if (Main.expertMode)
20748 {
20750 }
20751 if (this.
ai[2] >= (
float)num1040)
20752 {
20757 if (this.
ai[3] >= 3f)
20758 {
20761 if (Main.expertMode && Main.netMode != 1 && (
double)
life < (double)
lifeMax * 0.5)
20762 {
20764 this.
ai[3] += Main.rand.Next(1, 4);
20765 }
20768 {
20770 }
20771 }
20772 else
20773 {
20775 }
20776 }
20777 }
20778 else if (this.
ai[1] == 3f)
20779 {
20781 {
20788 {
20790 }
20791 }
20792 else if (Main.netMode != 1)
20793 {
20796 Vector2
vector2 =
default(Vector2);
20803 {
20805 }
20807 {
20809 }
20811 {
20814 }
20816 {
20818 }
20821 num1063 *= 1
f + (float)Main.rand.Next(-10, 11) * 0.01f;
20822 num1074 *= 1
f + (float)Main.rand.Next(-10, 11) * 0.01f;
20824 {
20825 num1063 *= 1
f + (float)Main.rand.Next(-10, 11) * 0.01f;
20826 num1074 *= 1
f + (float)Main.rand.Next(-10, 11) * 0.01f;
20827 }
20833 velocity.X += (float)Main.rand.Next(-20, 21) * 0.1f;
20834 velocity.Y += (float)Main.rand.Next(-20, 21) * 0.1f;
20836 {
20837 velocity.X += (float)Main.rand.Next(-50, 51) * 0.1f;
20838 velocity.Y += (float)Main.rand.Next(-50, 51) * 0.1f;
20841 if (
base.Center.X > Main.player[
target].Center.X)
20842 {
20844 }
20845 if (
base.Center.Y > Main.player[
target].Center.Y)
20846 {
20848 }
20853 velocity.X += (float)Main.rand.Next(-20, 21) * 0.1f;
20854 velocity.Y += (float)Main.rand.Next(-20, 21) * 0.1f;
20855 }
20857 {
20859 {
20862 if (
base.Center.X > Main.player[
target].Center.X)
20863 {
20865 }
20866 if (
base.Center.Y > Main.player[
target].Center.Y)
20867 {
20869 }
20872 }
20873 }
20875 {
20878 if (
base.Center.X > Main.player[
target].Center.X)
20879 {
20881 }
20882 if (
base.Center.Y > Main.player[
target].Center.Y)
20883 {
20885 }
20888 }
20892 {
20894 }
20895 }
20896 }
20897 else if (this.
ai[1] == 4f)
20898 {
20899 if (this.
ai[2] == 0f)
20900 {
20902 }
20905 if (this.
ai[2] == num1185 && Vector2.Distance(
position, Main.player[
target].position) < 200
f)
20906 {
20908 }
20909 if (this.
ai[2] >= num1185)
20910 {
20912 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
20913 {
20915 }
20916 if ((
double)velocity.Y > -0.1 && (double)
velocity.Y < 0.1)
20917 {
20919 }
20920 }
20921 else
20922 {
20924 }
20926 if (this.
ai[2] >= num1196)
20927 {
20930 {
20932 }
20935 if (this.
ai[3] >= 5f)
20936 {
20940 {
20947 }
20948 }
20949 else
20950 {
20952 }
20953 }
20954 }
20955 else if (this.
ai[1] == 5f)
20956 {
20960 Vector2
vector13 =
default(Vector2);
20969 {
20972 {
20974 }
20975 }
20977 {
20980 {
20982 }
20983 }
20985 {
20988 {
20990 }
20991 }
20993 {
20996 {
20998 }
20999 }
21001 if (this.
ai[2] >= 70f)
21002 {
21006 this.
ai[3] = Main.rand.Next(-3, 1);
21008 }
21009 }
21011 {
21013 }
21014 return;
21015 }
21017 {
21019 return;
21020 }
21022 {
21024 return;
21025 }
21027 {
21029 return;
21030 }
21032 {
21034 velocity.X *= 0.93f;
21036 {
21038 }
21039 if (this.
ai[0] == 0f)
21040 {
21042 }
21044 {
21046 {
21048 }
21050 {
21052 }
21053 }
21054 if (this.
ai[2] != 0f && this.
ai[3] != 0f)
21055 {
21058 {
21060 }
21063 {
21065 {
21073 dust87.velocity *= 3
f;
21074 if (Main.dust[
num1285].scale > 1
f)
21075 {
21076 Main.dust[
num1285].noGravity =
true;
21077 }
21078 }
21079 else if (
type == 32)
21080 {
21088 dust87.velocity *= 3
f;
21089 Main.dust[
num1296].noGravity =
true;
21090 }
21091 else if (
type == 283 ||
type == 284)
21092 {
21100 dust87.velocity *= 2
f;
21101 Main.dust[
num1307].scale = 1.4f;
21102 }
21103 else if (
type == 285 ||
type == 286)
21104 {
21112 dust87.velocity *= 3
f;
21113 Main.dust[
num1318].noGravity =
true;
21114 }
21115 else if (
type == 281 ||
type == 282)
21116 {
21124 dust87.velocity *= 3
f;
21125 Main.dust[
num1329].noGravity =
true;
21126 }
21127 else if (
type == 172)
21128 {
21136 dust87.velocity *= 3
f;
21137 Main.dust[
num1340].noGravity =
true;
21138 }
21139 else if (
type == 533)
21140 {
21148 dust87.velocity *= 3
f;
21149 Main.dust[
num1351].noGravity =
true;
21150 }
21151 else
21152 {
21160 dust87.velocity *= 3
f;
21161 Main.dust[
num1362].noGravity =
true;
21162 }
21163 }
21165 position.X = this.
ai[2] * 16f - (float)(
width / 2) + 8
f;
21166 position.Y = this.
ai[3] * 16f - (float)
height;
21174 {
21176 {
21184 dust87.velocity *= 3
f;
21185 if (Main.dust[
num1385].scale > 1
f)
21186 {
21187 Main.dust[
num1385].noGravity =
true;
21188 }
21189 }
21190 else if (
type == 32)
21191 {
21199 dust87.velocity *= 3
f;
21200 Main.dust[
num1396].noGravity =
true;
21201 }
21202 else if (
type == 172)
21203 {
21211 dust87.velocity *= 3
f;
21212 Main.dust[
num1407].noGravity =
true;
21213 }
21214 else if (
type == 283 ||
type == 284)
21215 {
21223 dust87.velocity *= 2
f;
21224 Main.dust[
num1418].scale = 1.4f;
21225 }
21226 else if (
type == 285 ||
type == 286)
21227 {
21235 dust87.velocity *= 3
f;
21236 Main.dust[
num1429].noGravity =
true;
21237 }
21238 else if (
type == 281 ||
type == 282)
21239 {
21247 dust87.velocity *= 3
f;
21248 Main.dust[
num1440].noGravity =
true;
21249 }
21250 else if (
type == 533)
21251 {
21259 dust87.velocity *= 3
f;
21260 Main.dust[
num1451].noGravity =
true;
21261 }
21262 else
21263 {
21271 dust87.velocity *= 3
f;
21272 Main.dust[
num1462].noGravity =
true;
21273 }
21274 }
21275 }
21278 {
21279 if (this.
ai[0] == 100f || this.
ai[0] == 150f || this.
ai[0] == 200f || this.
ai[0] == 250f || this.
ai[0] == 300f)
21280 {
21283 }
21284 if (this.
ai[0] >= 450f)
21285 {
21287 }
21288 }
21289 else if (
type == 172)
21290 {
21291 if (this.
ai[0] == 75f || this.
ai[0] == 150f || this.
ai[0] == 225f || this.
ai[0] == 300f || this.
ai[0] == 375f || this.
ai[0] == 450f)
21292 {
21295 }
21296 }
21297 else if (
type == 533)
21298 {
21299 if (this.
ai[0] == 180f)
21300 {
21303 }
21304 }
21305 else if (
type == 281 ||
type == 282)
21306 {
21307 if (this.
ai[0] == 100f || this.
ai[0] == 120f || this.
ai[0] == 140f || this.
ai[0] == 200f || this.
ai[0] == 220f || this.
ai[0] == 240f || this.
ai[0] == 300f || this.
ai[0] == 320f || this.
ai[0] == 340f)
21308 {
21311 }
21312 if (this.
ai[0] >= 540f)
21313 {
21315 }
21316 }
21317 else
21318 {
21319 if (Main.getGoodWorld &&
type == 24 &&
AnyNPCs(113))
21320 {
21322 if (this.
ai[0] % 2f == 1
f)
21323 {
21325 }
21326 }
21327 if (this.
ai[0] == 100f || this.
ai[0] == 200f || this.
ai[0] == 300f)
21328 {
21331 }
21332 }
21333 if ((
type == 285 ||
type == 286) && this.
ai[0] > 400f)
21334 {
21336 }
21337 if (
type == 533 && this.
ai[0] >= 360f)
21338 {
21340 }
21341 if (this.
ai[0] >= 650f && Main.netMode != 1)
21342 {
21348 {
21350 this.
ai[2] = chosenTile.X;
21351 this.
ai[3] = chosenTile.Y;
21352 }
21354 }
21355 if (this.
ai[1] > 0f)
21356 {
21359 {
21360 if (this.
ai[1] % 30f == 0
f && this.
ai[1] / 30f < 5
f)
21361 {
21363 if (Main.netMode != 1)
21364 {
21365 Point point =
base.Center.ToTileCoordinates();
21366 Point
point9 = Main.player[
target].Center.ToTileCoordinates();
21375 {
21377 }
21379 {
21384 {
21387 {
21389 }
21391 {
21393 }
21395 {
21398 break;
21399 }
21400 }
21401 }
21402 }
21403 }
21404 }
21405 else if (this.
ai[1] == 25f)
21406 {
21408 {
21409 if (Main.netMode != 1)
21410 {
21413 {
21415 }
21417 {
21419 }
21420 Vector2
vector35 =
default(Vector2);
21425 {
21426 num1562 += (float)Main.rand.Next(-30, 31);
21427 num1573 += (float)Main.rand.Next(-30, 31);
21430 }
21438 {
21441 }
21443 {
21446 }
21449 Main.projectile[
num14].timeLeft = 300;
21451 {
21452 Main.projectile[
num14].ai[0] = Main.player[
target].Center.X;
21453 Main.projectile[
num14].ai[1] = Main.player[
target].Center.Y;
21454 Main.projectile[
num14].netUpdate =
true;
21455 }
21457 }
21458 }
21459 else
21460 {
21462 {
21464 }
21465 if (Main.netMode != 1)
21466 {
21468 {
21470 }
21471 else if (
type == 45)
21472 {
21474 }
21475 else if (
type == 32)
21476 {
21478 }
21479 else if (
type == 172)
21480 {
21482 Vector2
vector46 =
default(Vector2);
21484 float num36 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
vector46.X + (
float)Main.rand.Next(-10, 11);
21485 float num47 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f -
vector46.Y + (
float)Main.rand.Next(-10, 11);
21493 Main.projectile[
num91].timeLeft = 300;
21495 }
21496 else
21497 {
21499 }
21500 }
21501 }
21502 }
21503 }
21506 {
21507 if (Main.rand.Next(5) == 0)
21508 {
21512 float speedX7 = velocity.X * 0.2f;
21513 float speedY6 = velocity.Y * 0.2f;
21516 Main.dust[
num102].noGravity =
true;
21517 Main.dust[
num102].velocity.X *= 0.5f;
21518 Main.dust[
num102].velocity.Y = -2
f;
21519 }
21520 }
21521 else if (
type == 32)
21522 {
21523 if (Main.rand.Next(3) != 0)
21524 {
21528 float speedX8 = velocity.X * 0.2f;
21529 float speedY7 = velocity.Y * 0.2f;
21532 Main.dust[
num114].noGravity =
true;
21533 Main.dust[
num114].velocity.X *= 0.3f;
21534 Main.dust[
num114].velocity.Y *= 0.2f;
21535 Main.dust[
num114].velocity.Y -= 1
f;
21536 }
21537 }
21538 else if (
type == 172)
21539 {
21542 {
21544 }
21546 {
21547 if (Main.rand.Next(255) > 255 -
alpha)
21548 {
21552 float speedX9 = velocity.X * 0.2f;
21553 float speedY8 = velocity.Y * 0.2f;
21556 Main.dust[
num147].noGravity =
true;
21557 Main.dust[
num147].velocity.X *= 0.1f + (float)Main.rand.Next(30) * 0.01f;
21558 Main.dust[
num147].velocity.Y *= 0.1f + (float)Main.rand.Next(30) * 0.01f;
21559 Dust dust = Main.dust[
num147];
21561 dust87.scale *= 1
f + (float)Main.rand.Next(6) * 0.1f;
21562 }
21563 }
21564 }
21565 else if (
type == 283 ||
type == 284)
21566 {
21567 if (Main.rand.Next(2) == 0)
21568 {
21574 Main.dust[
num158].velocity.X *= 0.5f;
21575 Main.dust[
num158].velocity.Y *= 0.5f;
21576 }
21577 }
21578 else if (
type == 285 ||
type == 286)
21579 {
21580 if (Main.rand.Next(2) == 0)
21581 {
21585 float speedX10 = velocity.X * 0.2f;
21586 float speedY9 = velocity.Y * 0.2f;
21589 Main.dust[
num169].noGravity =
true;
21592 dust87.velocity *= 0.4f;
21593 Main.dust[
num169].velocity.Y -= 0.7f;
21594 }
21595 }
21596 else if (
type == 281 ||
type == 282)
21597 {
21598 if (Main.rand.Next(2) == 0)
21599 {
21603 float speedX11 = velocity.X * 0.2f;
21604 float speedY10 = velocity.Y * 0.2f;
21607 Main.dust[
num180].noGravity =
true;
21610 dust87.velocity *= 0.5f;
21611 Main.dust[
num180].fadeIn = 1.2f;
21612 }
21613 }
21614 else if (
type == 533)
21615 {
21616 Lighting.AddLight(
base.Top, 0.6f, 0.6f, 0.3f);
21617 }
21618 else if (Main.rand.Next(2) == 0)
21619 {
21623 float speedX12 = velocity.X * 0.2f;
21624 float speedY11 = velocity.Y * 0.2f;
21627 Main.dust[
num191].noGravity =
true;
21628 Main.dust[
num191].velocity.X *= 1
f;
21629 Main.dust[
num191].velocity.Y *= 1
f;
21630 }
21632 return;
21633 }
21634 Vector2
val29 =
default(Vector2);
21636 {
21638 {
21640 {
21642 }
21643 if (this.
ai[0] == 0f)
21644 {
21649 {
21651 }
21653 val29 =
default(Vector2);
21656 {
21657 vector57.Y = 0.2f;
21658 }
21660 }
21662 {
21664 }
21665 }
21667 {
21671 {
21673 }
21675 {
21677 }
21678 if (Main.getGoodWorld)
21679 {
21681 {
21683 }
21685 {
21687 }
21689 {
21691 }
21692 }
21693 Vector2
vector68 =
default(Vector2);
21701 }
21703 {
21705 {
21707 }
21709 {
21711 }
21712 else if (
type == 666 && (
double)(base.Center.Y / 16
f) < Main.worldSurface)
21713 {
21715 }
21716 }
21718 {
21721 {
21723 }
21725 if (this.
ai[0] > 3f)
21726 {
21728 }
21729 if (this.
ai[0] == 2f)
21730 {
21734 {
21742 dust87.velocity *= 1.3f;
21746 Main.dust[
num258].noGravity =
true;
21747 }
21748 }
21749 }
21751 {
21754 }
21757 {
21766 {
21768 }
21771 {
21773 }
21774 return;
21775 }
21778 {
21780 {
21783 {
21787 float speedX13 = velocity.X * 0.2f;
21788 float speedY12 = velocity.Y * 0.2f;
21791 Main.dust[
num313].noGravity =
true;
21794 dust87.velocity *= 0.3f;
21795 Main.dust[
num313].velocity.X -= velocity.X * 0.2f;
21796 Main.dust[
num313].velocity.Y -= velocity.Y * 0.2f;
21797 }
21798 }
21799 else if (
type == 33)
21800 {
21802 {
21811 Main.dust[
num369].noGravity =
true;
21814 dust87.velocity *= 0.1f;
21817 dust87.velocity +=
velocity * 0.5f;
21820 }
21821 if (Main.rand.Next(5) == 0)
21822 {
21831 dust87.velocity *= 0.25f;
21834 dust87.velocity +=
velocity * 0.5f;
21835 }
21836 }
21837 else if (
type == 112 ||
type == 666)
21838 {
21842 float speedX14 = velocity.X * 0.1f;
21843 float speedY13 = velocity.Y * 0.1f;
21848 dust87.velocity *= 0.3f;
21849 Main.dust[
num402].noGravity =
true;
21850 }
21851 else
21852 {
21857 float speedX15 = velocity.X * 0.2f;
21858 float speedY14 = velocity.Y * 0.2f;
21861 Main.dust[
num413].noGravity =
true;
21862 Main.dust[
num413].velocity.X *= 0.3f;
21863 Main.dust[
num413].velocity.Y *= 0.3f;
21864 }
21865 }
21868 return;
21869 }
21871 {
21875 Vector2
vector90 =
default(Vector2);
21882 if (this.
ai[1] > 600f)
21883 {
21886 if (this.
ai[1] > 650f)
21887 {
21889 }
21890 }
21892 {
21893 this.
ai[0] += 0.9f;
21894 if (this.
ai[0] > 0f)
21895 {
21896 velocity.Y += 0.019f;
21897 }
21898 else
21899 {
21900 velocity.Y -= 0.019f;
21901 }
21902 if (this.
ai[0] < -100f || this.
ai[0] > 100f)
21903 {
21904 velocity.X += 0.019f;
21905 }
21906 else
21907 {
21908 velocity.X -= 0.019f;
21909 }
21910 if (this.
ai[0] > 200f)
21911 {
21912 this.
ai[0] = -200f;
21913 }
21914 }
21916 {
21919 }
21921 {
21924 }
21926 {
21929 }
21933 if (Main.player[
target].dead)
21934 {
21937 }
21939 {
21941 }
21943 {
21945 }
21947 {
21949 }
21951 {
21953 }
21955 {
21958 }
21960 {
21963 }
21965 {
21966 return;
21967 }
21969 {
21972 }
21978 {
21980 if (this.
ai[3] == 0f)
21981 {
21982 if (this.
ai[2] > 120f)
21983 {
21987 }
21988 return;
21989 }
21990 if (this.
ai[2] > 40f)
21991 {
21993 }
21994 if (Main.netMode != 1 &&
this.ai[2] == 20
f)
21995 {
22003 }
22004 }
22005 else
22006 {
22009 }
22010 return;
22011 }
22013 {
22016 if (this.
ai[0] == 0f && Main.netMode != 1)
22017 {
22021 {
22023 Main.npc[
num535].ai[0] = -1
f;
22026 Main.npc[
num535].netUpdate =
true;
22030 Main.npc[
num535].ai[3] = 150
f;
22032 Main.npc[
num535].netUpdate =
true;
22033 }
22034 }
22035 if ((
type == 68 || Main.netMode == 1) &&
localAI[0] == 0
f)
22036 {
22039 }
22041 {
22044 {
22046 }
22047 }
22048 if ((
type == 68 || Main.IsItDay()) &&
this.ai[1] != 3
f &&
this.ai[1] != 2
f)
22049 {
22052 }
22054 if (Main.expertMode)
22055 {
22057 {
22059 {
22061 }
22062 }
22065 {
22068 {
22070 }
22071 if (Main.getGoodWorld)
22072 {
22074 }
22075 if (Main.netMode != 1 &&
this.ai[2] %
num569 == 0
f)
22076 {
22082 {
22085 {
22087 }
22088 float num624 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
center23.X + (
float)Main.rand.Next(-20, 21);
22089 float num635 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f -
center23.Y + (
float)Main.rand.Next(-20, 21);
22105 Main.projectile[
num669].timeLeft = 300;
22106 }
22107 }
22108 }
22109 }
22110 if (this.
ai[1] == 0f)
22111 {
22114 if (this.
ai[2] >= 800f)
22115 {
22120 }
22126 if (Main.expertMode)
22127 {
22132 }
22133 if (Main.getGoodWorld)
22134 {
22139 }
22141 {
22143 {
22144 velocity.Y *= 0.98f;
22145 }
22148 {
22150 }
22151 }
22153 {
22155 {
22156 velocity.Y *= 0.98f;
22157 }
22160 {
22162 }
22163 }
22165 {
22167 {
22168 velocity.X *= 0.98f;
22169 }
22172 {
22174 }
22175 }
22177 {
22179 {
22180 velocity.X *= 0.98f;
22181 }
22184 {
22186 }
22187 }
22188 }
22189 else if (this.
ai[1] == 1f)
22190 {
22191 if (Main.getGoodWorld)
22192 {
22194 {
22196 }
22197 else if (Main.netMode != 1 &&
this.ai[2] % 200
f == 0
f &&
CountNPCS(32) < 6)
22198 {
22201 {
22204 {
22205 int num684 = (int)(
base.Center.X / 16
f) + Main.rand.Next(-50, 51);
22208 {
22209 }
22212 {
22214 if (Main.netMode == 2 &&
num687 < 200)
22215 {
22216 NetMessage.SendData(23, -1, -1,
null,
num687);
22217 }
22218 break;
22219 }
22220 }
22221 }
22222 }
22223 }
22226 if (this.
ai[2] == 2f)
22227 {
22229 }
22230 if (this.
ai[2] >= 400f)
22231 {
22234 }
22243 if (Main.expertMode)
22244 {
22247 {
22249 }
22251 {
22253 }
22255 {
22257 }
22259 {
22261 }
22263 {
22265 }
22267 {
22269 }
22271 {
22273 }
22275 {
22277 }
22279 {
22281 }
22283 {
22285 }
22287 {
22288 case 0:
22290 break;
22291 case 1:
22293 break;
22294 }
22295 }
22296 if (Main.getGoodWorld)
22297 {
22299 }
22303 }
22304 else if (this.
ai[1] == 2f)
22305 {
22317 }
22318 else if (this.
ai[1] == 3f)
22319 {
22320 velocity.Y += 0.1f;
22322 {
22323 velocity.Y *= 0.95f;
22324 }
22325 velocity.X *= 0.95f;
22327 }
22328 if (this.
ai[1] != 2f && this.
ai[1] != 3f &&
type != 68 && (
num546 != 0 || !Main.expertMode))
22329 {
22334 Main.dust[
num695].noGravity =
true;
22335 Main.dust[
num695].velocity.X *= 1.3f;
22336 Main.dust[
num695].velocity.X += velocity.X * 0.4f;
22339 {
22346 Main.dust[
num695].noGravity =
true;
22350 Main.dust[
num695].velocity.Y += 5
f;
22351 }
22352 }
22353 return;
22354 }
22356 {
22358 if (!Main.npc[(
int)this.
ai[1]].active || Main.npc[(int)this.
ai[1]].
aiStyle != 11)
22359 {
22361 if (this.
ai[2] > 50f || Main.netMode != 2)
22362 {
22366 }
22367 }
22368 if (this.
ai[2] == 0f || this.
ai[2] == 3f)
22369 {
22370 if (Main.npc[(
int)
this.ai[1]].ai[1] == 3
f)
22371 {
22373 }
22374 if (Main.npc[(
int)
this.ai[1]].ai[1] != 0
f)
22375 {
22376 if (
position.Y > Main.npc[(
int)
this.ai[1]].position.Y - 100
f)
22377 {
22379 {
22380 velocity.Y *= 0.96f;
22381 }
22382 velocity.Y -= 0.07f;
22384 {
22386 }
22387 }
22388 else if (
position.Y < Main.npc[(
int)
this.ai[1]].position.Y - 100
f)
22389 {
22391 {
22392 velocity.Y *= 0.96f;
22393 }
22394 velocity.Y += 0.07f;
22396 {
22398 }
22399 }
22400 if (
position.X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 120
f *
this.ai[0])
22401 {
22403 {
22404 velocity.X *= 0.96f;
22405 }
22406 velocity.X -= 0.1f;
22408 {
22410 }
22411 }
22412 if (
position.X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 120
f *
this.ai[0])
22413 {
22415 {
22416 velocity.X *= 0.96f;
22417 }
22418 velocity.X += 0.1f;
22420 {
22422 }
22423 }
22424 }
22425 else
22426 {
22428 if (Main.expertMode)
22429 {
22430 this.
ai[3] += 0.5f;
22431 }
22432 if (this.
ai[3] >= 300f)
22433 {
22437 }
22438 if (Main.expertMode)
22439 {
22440 if (
position.Y > Main.npc[(
int)
this.ai[1]].position.Y + 230
f)
22441 {
22443 {
22444 velocity.Y *= 0.96f;
22445 }
22446 velocity.Y -= 0.04f;
22448 {
22450 }
22451 }
22452 else if (
position.Y < Main.npc[(
int)
this.ai[1]].position.Y + 230
f)
22453 {
22455 {
22456 velocity.Y *= 0.96f;
22457 }
22458 velocity.Y += 0.04f;
22460 {
22462 }
22463 }
22464 if (
position.X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 200
f *
this.ai[0])
22465 {
22467 {
22468 velocity.X *= 0.96f;
22469 }
22470 velocity.X -= 0.07f;
22472 {
22474 }
22475 }
22476 if (
position.X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 200
f *
this.ai[0])
22477 {
22479 {
22480 velocity.X *= 0.96f;
22481 }
22482 velocity.X += 0.07f;
22484 {
22486 }
22487 }
22488 }
22489 if (
position.Y > Main.npc[(
int)
this.ai[1]].position.Y + 230
f)
22490 {
22492 {
22493 velocity.Y *= 0.96f;
22494 }
22495 velocity.Y -= 0.04f;
22497 {
22499 }
22500 }
22501 else if (
position.Y < Main.npc[(
int)
this.ai[1]].position.Y + 230
f)
22502 {
22504 {
22505 velocity.Y *= 0.96f;
22506 }
22507 velocity.Y += 0.04f;
22509 {
22511 }
22512 }
22513 if (
position.X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 200
f *
this.ai[0])
22514 {
22516 {
22517 velocity.X *= 0.96f;
22518 }
22519 velocity.X -= 0.07f;
22521 {
22523 }
22524 }
22525 if (
position.X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 200
f *
this.ai[0])
22526 {
22528 {
22529 velocity.X *= 0.96f;
22530 }
22531 velocity.X += 0.07f;
22533 {
22535 }
22536 }
22537 }
22540 float num698 = Main.npc[(int)this.
ai[1]].
position.X + (
float)(Main.npc[(int)this.
ai[1]].
width / 2) - 200f * this.
ai[0] - vector135.X;
22544 }
22545 else if (this.
ai[2] == 1f)
22546 {
22549 float num701 = Main.npc[(int)this.
ai[1]].
position.X + (
float)(Main.npc[(int)this.
ai[1]].
width / 2) - 200f * this.
ai[0] - vector146.X;
22553 velocity.X *= 0.95f;
22554 velocity.Y -= 0.1f;
22555 if (Main.expertMode)
22556 {
22557 velocity.Y -= 0.06f;
22559 {
22561 }
22562 }
22564 {
22566 }
22567 if (
position.Y < Main.npc[(
int)this.
ai[1]].position.Y - 200f)
22568 {
22579 }
22580 }
22581 else if (this.
ai[2] == 2f)
22582 {
22584 {
22586 }
22587 }
22588 else if (this.
ai[2] == 4f)
22589 {
22592 float num704 = Main.npc[(int)this.
ai[1]].
position.X + (
float)(Main.npc[(int)this.
ai[1]].
width / 2) - 200f * this.
ai[0] - vector157.X;
22596 velocity.Y *= 0.95f;
22597 velocity.X += 0.1f * (0
f - this.
ai[0]);
22598 if (Main.expertMode)
22599 {
22600 velocity.X += 0.07f * (0
f - this.
ai[0]);
22601 if (velocity.X < -12
f)
22602 {
22604 }
22606 {
22608 }
22609 }
22611 {
22613 }
22615 {
22617 }
22618 if (
position.X + (
float)(
width / 2) < Main.npc[(
int)this.
ai[1]].position.X + (float)(Main.npc[(
int)this.
ai[1]].width / 2) - 500f ||
position.X + (
float)(
width / 2) > Main.npc[(
int)this.
ai[1]].position.X + (float)(Main.npc[(
int)this.
ai[1]].width / 2) + 500f)
22619 {
22630 }
22631 }
22632 else if (this.
ai[2] == 5f && ((
velocity.X > 0
f &&
position.X + (
float)(
width / 2) > Main.player[
target].position.X + (
float)(Main.player[
target].width / 2)) || (velocity.X < 0
f && position.X + (float)(
width / 2) < Main.player[
target].position.X + (float)(Main.player[
target].width / 2))))
22633 {
22635 }
22636 return;
22637 }
22639 {
22640 if (this.
ai[0] < 0f || this.
ai[0] >= (
float)Main.maxTilesX || this.
ai[1] < 0f || this.
ai[1] >= (float)Main.maxTilesX)
22641 {
22642 return;
22643 }
22644 if (Main.tile[(
int)this.
ai[0], (int)this.
ai[1]] ==
null)
22645 {
22646 Main.tile[(int)this.
ai[0], (
int)this.
ai[1]] =
default(
Tile);
22647 }
22648 if (!Main.tile[(
int)this.
ai[0], (int)this.
ai[1]].
active())
22649 {
22653 return;
22654 }
22660 {
22661 num709 = ((!Main.getGoodWorld) ? 250
f : 350
f);
22662 }
22664 {
22666 }
22668 {
22670 }
22672 {
22675 }
22677 {
22680 }
22682 if (this.ai[2] > 300
f)
22683 {
22685 if (this.ai[2] > 450
f)
22686 {
22688 }
22689 }
22696 {
22700 }
22702 {
22705 {
22706 velocity.X +=
num708 * 1.5f;
22707 }
22708 }
22710 {
22713 {
22714 velocity.X -=
num708 * 1.5f;
22715 }
22716 }
22718 {
22721 {
22722 velocity.Y +=
num708 * 1.5f;
22723 }
22724 }
22726 {
22729 {
22730 velocity.Y -=
num708 * 1.5f;
22731 }
22732 }
22734 {
22735 if (Main.getGoodWorld)
22736 {
22737 if ((double)velocity.X > 3.5)
22738 {
22739 velocity.X = 3.5f;
22740 }
22741 if ((double)velocity.X < -3.5)
22742 {
22743 velocity.X = -3.5f;
22744 }
22745 if ((double)velocity.Y > 3.5)
22746 {
22747 velocity.Y = 3.5f;
22748 }
22749 if ((double)velocity.Y < -3.5)
22750 {
22751 velocity.Y = -3.5f;
22752 }
22753 }
22754 else
22755 {
22757 {
22759 }
22761 {
22763 }
22765 {
22767 }
22769 {
22771 }
22772 }
22773 }
22774 else if (
type == 175)
22775 {
22777 {
22779 }
22781 {
22783 }
22785 {
22787 }
22789 {
22791 }
22792 }
22793 else
22794 {
22796 {
22798 }
22800 {
22802 }
22804 {
22806 }
22808 {
22810 }
22811 }
22813 {
22815 }
22816 else
22817 {
22819 {
22822 }
22824 {
22827 }
22828 }
22830 {
22832 velocity.X = oldVelocity.X * -0.7f;
22834 {
22836 }
22838 {
22840 }
22841 }
22843 {
22845 velocity.Y = oldVelocity.Y * -0.7f;
22847 {
22849 }
22851 {
22853 }
22854 }
22855 if (Main.netMode == 1)
22856 {
22857 return;
22858 }
22859 if (
type == 101 && !Main.player[
target].DeadOrGhost)
22860 {
22862 {
22864 }
22867 {
22869 {
22872 num710 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
vector168.X + (
float)Main.rand.Next(-10, 11);
22873 num711 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f -
vector168.Y + (
float)Main.rand.Next(-10, 11);
22881 Main.projectile[
num715].timeLeft = 300;
22883 }
22884 else
22885 {
22887 }
22888 }
22889 }
22890 if (
type != 260 || Main.player[
target].DeadOrGhost)
22891 {
22892 return;
22893 }
22895 {
22897 }
22900 {
22901 return;
22902 }
22904 {
22907 num710 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
vector168.X + (
float)Main.rand.Next(-10, 11);
22910 {
22912 }
22921 Main.npc[
num720].netUpdate =
true;
22923 }
22924 else
22925 {
22927 }
22928 return;
22929 }
22931 {
22934 {
22935 velocity.X = oldVelocity.X * -0.5f;
22937 {
22939 }
22941 {
22943 }
22944 }
22946 {
22947 velocity.Y = oldVelocity.Y * -0.5f;
22949 {
22951 }
22953 {
22955 }
22956 }
22958 {
22962 {
22964 }
22966 {
22968 }
22971 {
22974 }
22975 }
22976 else
22977 {
22979 }
22981 {
22982 if ((
double)
position.Y < Main.worldSurface * 16.0 && Main.IsItDay() && !Main.eclipse)
22983 {
22986 }
22988 {
22989 velocity.X -= 0.2f;
22991 {
22992 velocity.X -= 0.1f;
22993 }
22995 {
22996 velocity.X += 0.05f;
22997 }
22999 {
23001 }
23002 }
23004 {
23005 velocity.X += 0.2f;
23007 {
23008 velocity.X += 0.1f;
23009 }
23011 {
23012 velocity.X -= 0.05f;
23013 }
23015 {
23017 }
23018 }
23020 {
23021 velocity.Y -= 0.2f;
23023 {
23024 velocity.Y -= 0.1f;
23025 }
23027 {
23028 velocity.Y += 0.05f;
23029 }
23031 {
23033 }
23034 }
23036 {
23037 velocity.Y += 0.2f;
23039 {
23040 velocity.Y += 0.1f;
23041 }
23043 {
23044 velocity.Y -= 0.05f;
23045 }
23047 {
23049 }
23050 }
23051 }
23052 else if (
type == 226)
23053 {
23055 {
23056 velocity.X -= 0.2f;
23058 {
23059 velocity.X -= 0.1f;
23060 }
23062 {
23063 velocity.X += 0.05f;
23064 }
23066 {
23068 }
23069 }
23071 {
23072 velocity.X += 0.2f;
23074 {
23075 velocity.X += 0.1f;
23076 }
23078 {
23079 velocity.X -= 0.05f;
23080 }
23082 {
23084 }
23085 }
23087 {
23088 velocity.Y -= 0.1f;
23090 {
23091 velocity.Y -= 0.05f;
23092 }
23094 {
23095 velocity.Y += 0.03f;
23096 }
23098 {
23099 velocity.Y = -2.5f;
23100 }
23101 }
23103 {
23104 velocity.Y += 0.1f;
23106 {
23107 velocity.Y += 0.05f;
23108 }
23110 {
23111 velocity.Y -= 0.03f;
23112 }
23114 {
23115 velocity.Y = 2.5f;
23116 }
23117 }
23118 }
23119 else if (
type == 660)
23120 {
23127 {
23132 }
23134 {
23137 {
23139 }
23141 {
23142 velocity.X +=
num723 * 0.5f;
23143 }
23145 {
23147 }
23148 }
23150 {
23153 {
23155 }
23157 {
23158 velocity.X -=
num723 * 0.5f;
23159 }
23161 {
23163 }
23164 }
23166 {
23169 {
23171 }
23173 {
23174 velocity.Y +=
num724 * 0.75f;
23175 }
23177 {
23179 }
23180 }
23182 {
23185 {
23187 }
23189 {
23190 velocity.Y -=
num724 * 0.75f;
23191 }
23193 {
23195 }
23196 }
23197 }
23198 else
23199 {
23201 {
23202 velocity.X -= 0.1f;
23204 {
23205 velocity.X -= 0.1f;
23206 }
23208 {
23209 velocity.X += 0.05f;
23210 }
23212 {
23214 }
23215 }
23217 {
23218 velocity.X += 0.1f;
23220 {
23221 velocity.X += 0.1f;
23222 }
23224 {
23225 velocity.X -= 0.05f;
23226 }
23228 {
23230 }
23231 }
23233 {
23234 velocity.Y -= 0.04f;
23236 {
23237 velocity.Y -= 0.05f;
23238 }
23240 {
23241 velocity.Y += 0.03f;
23242 }
23244 {
23245 velocity.Y = -1.5f;
23246 }
23247 }
23249 {
23250 velocity.Y += 0.04f;
23252 {
23253 velocity.Y += 0.05f;
23254 }
23256 {
23257 velocity.Y -= 0.03f;
23258 }
23260 {
23261 velocity.Y = 1.5f;
23262 }
23263 }
23264 }
23266 {
23268 {
23270 {
23271 velocity.Y *= 0.95f;
23272 }
23273 velocity.Y -= 0.5f;
23275 {
23277 }
23279 }
23281 {
23283 {
23284 velocity.X -= 0.1f;
23286 {
23287 velocity.X -= 0.07f;
23288 }
23290 {
23291 velocity.X += 0.03f;
23292 }
23294 {
23296 }
23297 }
23299 {
23300 velocity.X += 0.1f;
23302 {
23303 velocity.X += 0.07f;
23304 }
23306 {
23307 velocity.X -= 0.03f;
23308 }
23310 {
23312 }
23313 }
23315 {
23316 velocity.Y -= 0.04f;
23318 {
23319 velocity.Y -= 0.03f;
23320 }
23322 {
23323 velocity.Y += 0.02f;
23324 }
23326 {
23327 velocity.Y = -1.5f;
23328 }
23329 }
23331 {
23332 velocity.Y += 0.04f;
23334 {
23335 velocity.Y += 0.03f;
23336 }
23338 {
23339 velocity.Y -= 0.02f;
23340 }
23342 {
23343 velocity.Y = 1.5f;
23344 }
23345 }
23346 }
23347 else
23348 {
23350 {
23351 velocity.X -= 0.1f;
23353 {
23354 velocity.X -= 0.1f;
23355 }
23357 {
23358 velocity.X += 0.05f;
23359 }
23361 {
23363 }
23364 }
23366 {
23367 velocity.X += 0.1f;
23369 {
23370 velocity.X += 0.1f;
23371 }
23373 {
23374 velocity.X -= 0.05f;
23375 }
23377 {
23379 }
23380 }
23382 {
23383 velocity.Y -= 0.04f;
23385 {
23386 velocity.Y -= 0.05f;
23387 }
23389 {
23390 velocity.Y += 0.03f;
23391 }
23393 {
23394 velocity.Y = -1.5f;
23395 }
23396 }
23398 {
23399 velocity.Y += 0.04f;
23401 {
23402 velocity.Y += 0.05f;
23403 }
23405 {
23406 velocity.Y -= 0.03f;
23407 }
23409 {
23410 velocity.Y = 1.5f;
23411 }
23412 }
23413 }
23414 }
23416 {
23418 {
23419 velocity.Y *= 0.95f;
23420 }
23421 velocity.Y -= 0.5f;
23423 {
23425 }
23427 }
23428 if (
type == 158 && Main.netMode != 1)
23429 {
23436 {
23438 }
23439 }
23442 {
23444 }
23445 if (this.ai[1] > 200
f)
23446 {
23448 {
23450 }
23456 {
23461 }
23462 if (this.ai[1] > 1000
f)
23463 {
23465 }
23467 if (this.ai[2] > 0
f)
23468 {
23470 {
23472 }
23473 }
23475 {
23477 }
23478 if (this.ai[2] < -150
f || this.ai[2] > 150
f)
23479 {
23481 {
23483 }
23484 }
23486 {
23488 }
23489 if (this.ai[2] > 300
f)
23490 {
23491 this.ai[2] = -300
f;
23492 }
23493 }
23494 if (Main.netMode == 1)
23495 {
23496 return;
23497 }
23499 {
23501 if (this.ai[0] == 30
f || this.ai[0] == 60
f || this.ai[0] == 90
f)
23502 {
23504 {
23508 float num737 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
vector190.X + (
float)Main.rand.Next(-100, 101);
23509 float num738 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f -
vector190.Y + (
float)Main.rand.Next(-100, 101);
23517 Main.projectile[
num743].timeLeft = 300;
23518 }
23519 }
23520 else if (this.ai[0] >= (float)(400 + Main.rand.Next(400)))
23521 {
23523 }
23524 }
23526 {
23528 if (this.ai[0] == 20
f || this.ai[0] == 40
f || this.ai[0] == 60
f || this.ai[0] == 80
f)
23529 {
23531 {
23535 float num745 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
vector201.X + (
float)Main.rand.Next(-100, 101);
23536 float num746 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f -
vector201.Y + (
float)Main.rand.Next(-100, 101);
23544 Main.projectile[
num750].timeLeft = 300;
23545 }
23546 }
23547 else if (this.ai[0] >= (float)(300 + Main.rand.Next(300)))
23548 {
23550 }
23551 }
23553 {
23554 return;
23555 }
23557 if (this.ai[0] == 20
f || this.ai[0] == 40
f || this.ai[0] == 60
f || this.ai[0] == 80
f || this.ai[0] == 100
f)
23558 {
23560 {
23564 float num753 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
vector212.X + (
float)Main.rand.Next(-50, 51);
23565 float num754 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f -
vector212.Y + (
float)Main.rand.Next(-50, 51);
23574 Main.projectile[
num758].timeLeft = 300;
23575 }
23576 }
23577 else if (this.ai[0] >= (float)(250 + Main.rand.Next(250)))
23578 {
23580 }
23581 return;
23582 }
23584 {
23591 if (Main.getGoodWorld)
23592 {
23595 }
23597 if (this.ai[3] == 0
f &&
life > 0)
23598 {
23600 }
23602 {
23605 if (Main.netMode != 1)
23606 {
23607 this.ai[0] = -100
f;
23610 }
23611 }
23613 if (Main.player[
target].dead || Vector2.Distance(
base.Center, Main.player[
target].Center) > (
float)
num762)
23614 {
23616 if (Main.player[
target].dead || Vector2.Distance(
base.Center, Main.player[
target].Center) > (
float)
num762)
23617 {
23619 if (Main.player[
target].Center.X <
base.Center.X)
23620 {
23622 }
23623 else
23624 {
23626 }
23627 if (Main.netMode != 1 &&
this.ai[1] != 5
f)
23628 {
23633 localAI[1] = Main.maxTilesX * 16;
23634 localAI[2] = Main.maxTilesY * 16;
23635 }
23636 }
23637 }
23639 {
23643 if (Main.netMode != 1)
23644 {
23647 Point
point11 = Main.player[
target].Center.ToTileCoordinates();
23655 {
23657 {
23659 }
23662 }
23664 {
23669 {
23670 continue;
23671 }
23675 {
23677 }
23678 else
23679 {
23681 {
23684 {
23686 break;
23687 }
23688 }
23689 }
23693 {
23695 }
23696 if (
flag2 && !Collision.CanHitLine(
base.Center, 0, 0, Main.player[
target].Center, 0, 0))
23697 {
23699 }
23701 {
23705 break;
23706 }
23707 }
23709 {
23713 }
23714 }
23715 }
23716 if (!Collision.CanHitLine(
base.Center, 0, 0, Main.player[
target].Center, 0, 0) ||
Math.Abs(
base.Top.Y - Main.player[
target].Bottom.Y) > 160
f)
23717 {
23718 this.ai[2]++;
23719 if (Main.netMode != 1)
23720 {
23722 }
23723 }
23724 else if (Main.netMode != 1)
23725 {
23728 {
23730 }
23731 }
23732 if (
timeLeft < 10 && (this.ai[0] != 0
f || this.ai[1] != 0
f))
23733 {
23738 }
23741 if (this.ai[1] == 5
f)
23742 {
23745 this.ai[0]++;
23748 if (this.ai[0] >= 60
f)
23749 {
23751 }
23752 if (this.ai[0] == 60
f)
23753 {
23755 }
23756 if (this.ai[0] >= 60
f && Main.netMode != 1)
23757 {
23762 }
23763 if (Main.netMode == 1 &&
this.ai[0] >= 120
f)
23764 {
23767 }
23769 {
23771 {
23772 int num775 = Dust.NewDust(
position + Vector2.UnitX * -20
f,
width + 40,
height, 4,
velocity.X,
velocity.Y, 150,
new Color(78, 136, 255, 80), 2
f);
23773 Main.dust[
num775].noGravity =
true;
23776 dust87.velocity *= 0.5f;
23777 }
23778 }
23779 }
23780 else if (this.ai[1] == 6
f)
23781 {
23784 this.ai[0]++;
23787 if (this.ai[0] >= 30
f && Main.netMode != 1)
23788 {
23793 }
23794 if (Main.netMode == 1 &&
this.ai[0] >= 60
f)
23795 {
23799 }
23801 {
23802 int num777 = Dust.NewDust(
position + Vector2.UnitX * -20
f,
width + 40,
height, 4,
velocity.X,
velocity.Y, 150,
new Color(78, 136, 255, 80), 2
f);
23803 Main.dust[
num777].noGravity =
true;
23806 dust87.velocity *= 2
f;
23807 }
23808 }
23811 {
23812 velocity.X *= 0.8f;
23813 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
23814 {
23816 }
23818 {
23821 {
23823 }
23825 {
23827 }
23829 {
23831 }
23833 {
23835 }
23837 {
23839 }
23840 if (this.ai[0] >= 0
f)
23841 {
23844 if (this.ai[1] == 3
f)
23845 {
23848 this.ai[0] = -200
f;
23850 }
23851 else if (this.ai[1] == 2
f)
23852 {
23855 this.ai[0] = -120
f;
23857 }
23858 else
23859 {
23862 this.ai[0] = -120
f;
23864 }
23865 }
23866 else if (this.ai[0] >= -30
f)
23867 {
23869 }
23870 }
23871 }
23873 {
23875 if (Main.getGoodWorld)
23876 {
23878 }
23880 {
23882 {
23884 }
23885 else
23886 {
23887 velocity.X *= 0.93f;
23888 }
23889 }
23890 }
23891 int num779 = Dust.NewDust(
position,
width,
height, 4,
velocity.X,
velocity.Y, 255,
new Color(0, 80, 255, 80),
scale * 1.2f);
23892 Main.dust[
num779].noGravity =
true;
23895 dust87.velocity *= 0.5f;
23897 {
23898 return;
23899 }
23905 {
23906 position.X +=
width / 2;
23911 position.X -=
width / 2;
23913 }
23914 if (Main.netMode == 1)
23915 {
23916 return;
23917 }
23920 {
23921 return;
23922 }
23924 int num782 = Main.rand.Next(1, 4);
23926 {
23927 int x = (int)(
position.X + (
float)Main.rand.Next(
width - 32));
23930 if (Main.expertMode && Main.rand.Next(4) == 0)
23931 {
23933 }
23936 Main.npc[
num786].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f;
23937 Main.npc[
num786].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f;
23938 Main.npc[
num786].ai[0] = -1000 * Main.rand.Next(3);
23940 if (Main.netMode == 2 &&
num786 < 200)
23941 {
23942 NetMessage.SendData(23, -1, -1,
null,
num786);
23943 }
23944 }
23945 return;
23946 }
23948 {
23950 {
23952 }
23954 {
23955 if (this.ai[2] == 0
f)
23956 {
23957 int num787 = Main.rand.Next(300, 1200);
23958 if ((this.ai[3] += 1
f) >= (
float)
num787)
23959 {
23960 this.ai[2] = Main.rand.Next(1, 3);
23962 {
23964 }
23965 if (this.ai[2] == 2
f)
23966 {
23968 }
23971 }
23972 }
23973 if (this.ai[2] == 1
f)
23974 {
23976 {
23980 }
23982 {
23983 velocity.Y -= 0.4f;
23985 {
23987 }
23990 {
23992 }
23994 {
23996 }
23997 if (this.ai[3] == 1
f)
23998 {
24002 }
24003 }
24004 else
24005 {
24008 velocity.Y += 0.3f;
24010 {
24012 }
24013 }
24014 return;
24015 }
24016 if (this.ai[2] == 2
f)
24017 {
24019 {
24023 }
24025 {
24026 velocity.Y -= 0.4f;
24028 {
24030 }
24033 {
24035 }
24037 {
24039 }
24041 {
24046 velocity.X *= 0.95f;
24047 if (this.ai[3] == 0
f)
24048 {
24050 }
24051 this.ai[3]++;
24052 if (this.ai[3] >= 300
f)
24053 {
24058 }
24059 if (this.ai[3] == 60
f && Main.rand.Next(2) == 0)
24060 {
24062 }
24063 }
24064 }
24065 else
24066 {
24070 velocity.Y += 0.3f;
24072 {
24074 }
24075 }
24076 return;
24077 }
24078 }
24080 {
24083 {
24086 {
24088 }
24089 }
24093 {
24095 {
24098 }
24099 else
24100 {
24103 }
24104 }
24106 {
24108 {
24111 }
24112 else
24113 {
24116 }
24117 }
24119 {
24121 {
24125 }
24127 {
24130 {
24134 }
24136 {
24140 }
24141 }
24142 }
24144 {
24145 Lighting.AddLight((
int)(position.X + (float)(
width / 2) + (float)(
direction * (
width + 8))) / 16, (int)(
position.Y + 2
f) / 16, 0.07f, 0.04f, 0.025f);
24146 }
24148 {
24151 {
24153 {
24154 velocity.X *= 0.95f;
24155 }
24157 {
24158 velocity.X *= 0.95f;
24159 }
24163 {
24165 }
24167 {
24169 }
24171 {
24173 }
24175 {
24177 }
24178 }
24179 else if (
type == 65 ||
type == 102)
24180 {
24184 {
24186 }
24188 {
24190 }
24192 {
24194 }
24196 {
24198 }
24199 }
24200 else
24201 {
24205 {
24207 }
24209 {
24211 }
24213 {
24215 }
24217 {
24219 }
24220 }
24221 }
24222 else
24223 {
24225 {
24227 {
24229 }
24230 else
24231 {
24233 }
24236 {
24237 velocity.X *= 0.95f;
24238 }
24239 if (this.ai[0] == -1
f)
24240 {
24243 {
24245 }
24247 {
24249 }
24250 velocity.Y -= 0.02f;
24252 {
24254 }
24255 }
24256 else
24257 {
24260 {
24262 }
24264 {
24266 }
24267 velocity.Y += 0.02f;
24269 {
24271 }
24272 }
24273 }
24274 else
24275 {
24279 {
24281 }
24283 {
24284 velocity.X *= 0.95f;
24285 }
24286 if (this.ai[0] == -1
f)
24287 {
24288 velocity.Y -= 0.01f;
24289 if ((double)velocity.Y < -0.3)
24290 {
24292 }
24293 }
24294 else
24295 {
24296 velocity.Y += 0.01f;
24297 if ((double)velocity.Y > 0.3)
24298 {
24300 }
24301 }
24302 }
24306 {
24308 }
24310 {
24312 }
24314 {
24316 }
24318 {
24320 {
24322 }
24324 {
24326 }
24327 }
24328 if (
type != 157 && ((
double)velocity.Y > 0.4 || (double)
velocity.Y < -0.4))
24329 {
24330 velocity.Y *= 0.95f;
24331 }
24332 }
24333 }
24334 else
24335 {
24337 {
24339 {
24340 velocity.X *= 0.94f;
24341 if ((
double)velocity.X > -0.2 && (double)
velocity.X < 0.2)
24342 {
24344 }
24345 }
24346 else if (Main.netMode != 1)
24347 {
24348 velocity.Y = (float)Main.rand.Next(-50, -20) * 0.1f;
24349 velocity.X = (float)Main.rand.Next(-20, 20) * 0.1f;
24351 }
24352 }
24353 velocity.Y += 0.3f;
24355 {
24357 }
24359 }
24362 {
24364 }
24366 {
24368 }
24369 return;
24370 }
24373 {
24375 if (this.ai[0] == 0
f)
24376 {
24379 if (Main.netMode != 1)
24380 {
24382 {
24385 }
24386 else
24387 {
24388 Rectangle
rectangle =
default(Rectangle);
24392 {
24396 }
24397 }
24398 }
24399 }
24400 else if (!Main.player[
target].dead)
24401 {
24403 {
24404 velocity.X = oldVelocity.X * -0.5f;
24406 {
24408 }
24410 {
24412 }
24413 }
24415 {
24416 velocity.Y = oldVelocity.Y * -0.5f;
24418 {
24420 }
24422 {
24424 }
24425 }
24428 {
24429 velocity.X -= 0.1f;
24431 {
24432 velocity.X -= 0.1f;
24433 }
24435 {
24436 velocity.X -= 0.05f;
24437 }
24439 {
24441 }
24442 }
24444 {
24445 velocity.X += 0.1f;
24447 {
24448 velocity.X += 0.1f;
24449 }
24451 {
24452 velocity.X += 0.05f;
24453 }
24455 {
24457 }
24458 }
24462 {
24464 }
24466 {
24467 velocity.Y += 0.05f;
24469 {
24470 velocity.Y += 0.01f;
24471 }
24472 }
24473 else
24474 {
24475 velocity.Y -= 0.05f;
24477 {
24478 velocity.Y -= 0.01f;
24479 }
24480 }
24482 {
24484 }
24486 {
24488 }
24489 }
24491 {
24493 {
24494 velocity.Y *= 0.95f;
24495 }
24496 velocity.Y -= 0.5f;
24498 {
24500 }
24502 }
24503 return;
24504 }
24506 {
24508 if (
wet && this.ai[1] == 1
f)
24509 {
24511 }
24512 else
24513 {
24515 }
24516 if (Main.expertMode && (
type == 63 ||
type == 64 ||
type == 103 ||
type == 242))
24517 {
24519 {
24521 {
24523 if (((Vector2)(
ref val29)).Length() < 150
f)
24524 {
24525 if (this.ai[1] == 0
f)
24526 {
24528 }
24529 else
24530 {
24531 this.ai[2] -= 0.25f;
24532 }
24533 }
24534 }
24536 {
24539 if (this.ai[2] >= 120
f)
24540 {
24542 }
24543 }
24544 else
24545 {
24547 if (this.ai[2] >= 420
f)
24548 {
24551 }
24552 }
24553 }
24554 else
24555 {
24558 }
24559 }
24562 {
24564 }
24566 {
24568 }
24569 else if (
type == 103)
24570 {
24572 }
24573 else if (
type != 221 &&
type != 242)
24574 {
24576 }
24578 {
24580 }
24582 {
24583 return;
24584 }
24586 {
24590 {
24592 {
24595 }
24596 else
24597 {
24600 }
24601 }
24603 {
24605 {
24608 }
24609 else
24610 {
24613 }
24614 }
24616 {
24619 }
24621 {
24623 {
24627 }
24629 {
24633 }
24634 }
24637 {
24640 {
24642 }
24643 }
24645 {
24651 {
24654 }
24656 {
24659 }
24661 {
24664 }
24666 {
24668 {
24670 }
24674 {
24676 }
24687 }
24688 return;
24689 }
24694 {
24695 velocity.X *= 0.95f;
24696 }
24697 if (this.ai[0] == -1
f)
24698 {
24699 velocity.Y -= 0.01f;
24701 {
24703 }
24704 }
24705 else
24706 {
24707 velocity.Y += 0.01f;
24709 {
24711 }
24712 }
24716 {
24718 }
24720 {
24722 }
24724 {
24726 }
24728 {
24730 {
24732 }
24734 {
24736 }
24737 }
24738 else
24739 {
24741 }
24742 if ((
double)velocity.Y > 1.2 || (double)
velocity.Y < -1.2)
24743 {
24744 velocity.Y *= 0.99f;
24745 }
24746 return;
24747 }
24750 {
24751 velocity.X *= 0.98f;
24752 if ((
double)velocity.X > -0.01 && (double)
velocity.X < 0.01)
24753 {
24755 }
24756 }
24757 velocity.Y += 0.2f;
24759 {
24761 }
24763 return;
24764 }
24766 {
24779 {
24783 {
24785 }
24787 {
24789 }
24791 {
24792 velocity.X *= 0.9f;
24794 {
24797 }
24798 }
24799 }
24800 if (this.ai[0] > 0
f)
24801 {
24802 if (this.ai[0] == 200
f)
24803 {
24805 }
24807 }
24809 {
24814 Main.projectile[
num815].ai[0] = 2
f;
24815 Main.projectile[
num815].timeLeft = 300;
24816 Main.projectile[
num815].friendly =
false;
24817 NetMessage.SendData(27, -1, -1,
null,
num815);
24819 }
24820 try
24821 {
24828 {
24830 }
24832 {
24834 }
24836 {
24838 }
24840 {
24842 }
24844 {
24847 velocity.Y = -0.2f;
24848 return;
24849 }
24852 if (Main.rand.Next(2) == 0)
24853 {
24860 Main.dust[
num821].velocity.X *= 0.4f;
24861 Main.dust[
num821].velocity.Y *= -1
f;
24862 if (Main.rand.Next(2) == 0)
24863 {
24864 Main.dust[
num821].noGravity =
true;
24867 dust87.scale += 0.2f;
24868 }
24870 }
24871 return;
24872 }
24873 catch
24874 {
24875 return;
24876 }
24877 }
24879 {
24880 if (this.ai[0] == 0
f)
24881 {
24882 if (Main.netMode != 1)
24883 {
24887 position.Y +=
height / 2 + 8;
24888 this.ai[1] = position.X + (float)(
width / 2);
24889 this.ai[2] = position.Y + (float)(
height / 2);
24891 {
24893 }
24895 {
24897 }
24898 this.ai[3] = 1
f + (float)Main.rand.Next(15) * 0.1f;
24899 velocity.Y = (float)(
directionY * 6) * this.ai[3];
24902 }
24903 else
24904 {
24905 this.ai[1] = position.X + (float)(
width / 2);
24906 this.ai[2] = position.Y + (float)(
height / 2);
24907 }
24908 return;
24909 }
24910 float num822 = 6
f * this.ai[3];
24911 float num823 = 0.2f * this.ai[3];
24913 if (this.ai[0] >= 1
f && this.ai[0] < (
float)(
int)
num824)
24914 {
24917 return;
24918 }
24919 if (this.ai[0] >= (
float)(int)
num824)
24920 {
24925 return;
24926 }
24928 {
24930 {
24933 }
24934 }
24936 {
24939 }
24941 {
24943 {
24946 }
24947 }
24949 {
24952 }
24955 }
24957 {
24958 if (this.ai[0] == 0
f)
24959 {
24963 }
24965 if (this.ai[1] == 0
f)
24966 {
24969 {
24971 }
24973 {
24977 }
24979 {
24982 }
24983 }
24984 else
24985 {
24988 {
24990 }
24992 {
24996 }
24998 {
25001 }
25002 }
25005 float num826 = (float)(270 - Main.mouseTextColor) / 400
f;
25006 Lighting.AddLight((
int)(position.X + (float)(
width / 2)) / 16, (
int)(position.Y + (float)(
height / 2)) / 16, 0.9
f, 0.3
f +
num826, 0.2
f);
25007 }
25009 {
25011 bool flag21 =
type == 330 && !Main.pumpkinMoon;
25012 if (
type == 253 && !Main.eclipse)
25013 {
25015 }
25016 if (
type == 490 && Main.dayTime)
25017 {
25019 }
25021 {
25023 }
25024 if (
type == 316 && (Main.player[
target].dead || Vector2.Distance(
base.Center, Main.player[
target].Center) > 3000
f))
25025 {
25027 if (Main.player[
target].dead || Vector2.Distance(
base.Center, Main.player[
target].Center) > 3000
f)
25028 {
25032 }
25033 }
25035 {
25037 {
25038 velocity.X = (float)Main.rand.Next(-1, 2) * 1.5f;
25040 }
25041 }
25042 else if (this.ai[2] >= 0
f)
25043 {
25048 {
25050 }
25052 {
25054 }
25057 {
25059 }
25061 {
25063 if (this.ai[2] >= 30
f &&
num827 == 16)
25064 {
25066 }
25067 if (this.ai[2] >= 60
f)
25068 {
25069 this.ai[2] = -200
f;
25073 }
25074 }
25075 else
25076 {
25080 }
25082 }
25083 else if (
type == 253)
25084 {
25087 }
25088 else
25089 {
25091 {
25092 this.ai[2] += 0.1f;
25093 }
25094 else
25095 {
25097 }
25099 {
25101 }
25102 else
25103 {
25105 }
25106 }
25113 {
25115 {
25118 }
25119 if (Main.netMode != 1 &&
this.ai[3] == 32
f && !Main.player[
target].npcTypeNoAggro[
type])
25120 {
25138 }
25140 if (this.ai[3] > 0
f)
25141 {
25143 if (this.ai[3] >= 64
f)
25144 {
25146 }
25147 }
25148 if (Main.netMode != 1 &&
this.ai[3] == 0
f)
25149 {
25152 {
25156 }
25157 }
25158 }
25159 else if (
type == 75)
25160 {
25163 if (Main.rand.Next(6) == 0)
25164 {
25168 dust87.velocity *= 0.3f;
25169 }
25170 if (Main.rand.Next(40) == 0)
25171 {
25173 }
25175 }
25176 else if (
type == 169)
25177 {
25179 Lighting.AddLight((
int)((position.X + (float)(
width / 2)) / 16
f), (int)((
position.Y + (
float)(
height / 2)) / 16
f), 0
f, 0.6
f, 0.75
f);
25181 if (Main.rand.Next(3) == 0)
25182 {
25190 dust87.velocity *= 0.3f;
25191 Main.dust[
num844].noGravity =
true;
25192 }
25195 {
25198 }
25210 {
25212 }
25213 else
25214 {
25216 }
25219 {
25221 }
25222 else
25223 {
25225 }
25226 if (Main.netMode != 1 &&
this.ai[3] == 16
f)
25227 {
25231 }
25233 if (this.ai[3] > 0
f)
25234 {
25236 if (this.ai[3] >= 64
f)
25237 {
25239 }
25240 }
25241 if (Main.netMode != 1 &&
this.ai[3] == 0
f)
25242 {
25245 {
25249 }
25250 }
25251 }
25252 else if (
type == 268)
25253 {
25256 if (Main.netMode != 1 && !
confused)
25257 {
25260 {
25263 }
25264 if (Main.netMode != 1 && this.ai[3] >= (float)(60 + Main.rand.Next(60)))
25265 {
25268 {
25275 num855 += (float)Main.rand.Next(-10, 11);
25276 num857 += (float)Main.rand.Next(-30, 21);
25285 }
25286 }
25287 }
25288 }
25290 {
25293 {
25298 {
25300 }
25302 }
25303 }
25305 {
25307 {
25309 }
25310 else
25311 {
25313 {
25315 {
25317 }
25319 {
25321 {
25323 }
25325 break;
25326 }
25327 }
25328 }
25329 }
25330 if (Main.player[
target].npcTypeNoAggro[
type])
25331 {
25334 {
25336 {
25338 }
25340 {
25342 break;
25343 }
25344 }
25346 }
25348 {
25350 {
25352 {
25354 }
25356 {
25359 break;
25360 }
25361 }
25362 }
25364 {
25368 {
25370 }
25371 }
25373 {
25375 {
25376 velocity.Y += 0.2f;
25378 {
25380 }
25381 }
25382 else if (
type == 490)
25383 {
25384 velocity.Y += 0.03f;
25385 if ((double)velocity.Y > 0.75)
25386 {
25387 velocity.Y = 0.75f;
25388 }
25389 }
25390 else
25391 {
25392 velocity.Y += 0.1f;
25394 {
25395 velocity.Y -= 0.05f;
25397 {
25399 }
25400 }
25402 {
25404 }
25405 }
25406 }
25407 else
25408 {
25410 {
25412 {
25413 velocity.Y -= 0.2f;
25414 }
25415 }
25416 else if (
type == 490)
25417 {
25419 {
25420 velocity.Y -= 0.075f;
25421 }
25423 {
25424 velocity.Y = -0.75f;
25425 }
25426 }
25428 {
25429 velocity.Y -= 0.1f;
25430 }
25432 {
25434 }
25435 }
25437 {
25438 velocity.Y -= 0.2f;
25440 {
25442 }
25443 }
25445 {
25446 velocity.X = oldVelocity.X * -0.4f;
25448 {
25450 }
25452 {
25454 }
25455 }
25457 {
25458 velocity.Y = oldVelocity.Y * -0.25f;
25460 {
25462 }
25464 {
25466 }
25467 }
25470 {
25472 }
25474 {
25476 }
25478 {
25480 }
25482 {
25486 {
25488 }
25489 else
25490 {
25492 }
25494 {
25495 velocity.X *= 0.9f;
25496 }
25498 {
25499 velocity.X *= 0.9f;
25500 }
25501 }
25503 {
25504 velocity.X -= 0.1f;
25506 {
25507 velocity.X -= 0.1f;
25508 }
25510 {
25511 velocity.X += 0.05f;
25512 }
25514 {
25516 }
25517 }
25519 {
25520 velocity.X += 0.1f;
25522 {
25523 velocity.X += 0.1f;
25524 }
25526 {
25527 velocity.X -= 0.05f;
25528 }
25530 {
25532 }
25533 }
25536 {
25537 velocity.Y -= 0.04f;
25539 {
25540 velocity.Y -= 0.05f;
25541 }
25543 {
25544 velocity.Y += 0.03f;
25545 }
25547 {
25549 }
25550 }
25552 {
25553 velocity.Y += 0.04f;
25555 {
25556 velocity.Y += 0.05f;
25557 }
25559 {
25560 velocity.Y -= 0.03f;
25561 }
25563 {
25565 }
25566 }
25568 {
25569 Lighting.AddLight((
int)
position.X / 16, (
int)
position.Y / 16, 0.4f, 0
f, 0.25f);
25570 }
25571 }
25573 {
25577 {
25579 }
25580 else if (
type == 179)
25581 {
25583 }
25584 else
25585 {
25587 }
25589 {
25591 }
25592 if (this.ai[0] == 0
f)
25593 {
25610 }
25611 else if (this.ai[0] == 1
f)
25612 {
25614 {
25617 }
25620 if (this.ai[1] >= 100
f)
25621 {
25627 }
25628 else
25629 {
25631 }
25632 }
25633 else
25634 {
25636 {
25639 }
25642 float num875 = this.ai[1] / 120
f;
25645 if (this.ai[1] >= 120
f)
25646 {
25650 }
25651 }
25652 }
25654 {
25657 {
25659 {
25664 }
25665 else if (this.ai[0] == 1
f && Main.cloudAlpha == 0
f && !Main.dayTime)
25666 {
25668 {
25670 {
25671 continue;
25672 }
25673 if (Main.npc[
num876].townNPC)
25674 {
25676 {
25679 {
25681 }
25682 }
25683 }
25685 {
25687 break;
25688 }
25689 }
25690 }
25691 }
25692 if (this.ai[0] == 0
f)
25693 {
25695 if (
type == 611 && (Main.cloudAlpha > 0
f || Main.dayTime))
25696 {
25698 }
25700 if (Main.netMode != 1)
25701 {
25703 {
25707 }
25708 else if (
type != 611)
25709 {
25714 {
25719 }
25720 }
25721 }
25722 }
25723 else if (this.ai[0] == 2
f)
25724 {
25725 velocity.X *= 0.98f;
25727 {
25730 }
25731 velocity.Y += 0.05f;
25733 {
25735 }
25736 }
25737 else if (!Main.player[
target].dead)
25738 {
25741 {
25743 }
25745 {
25747 velocity.X = oldVelocity.X * -0.5f;
25749 {
25751 }
25753 {
25755 }
25756 }
25758 {
25759 velocity.Y = oldVelocity.Y * -0.5f;
25761 {
25763 }
25765 {
25767 }
25768 }
25770 {
25771 velocity.X -= 0.1f;
25773 {
25774 velocity.X -= 0.1f;
25775 }
25777 {
25778 velocity.X -= 0.05f;
25779 }
25781 {
25783 }
25784 }
25786 {
25787 velocity.X += 0.1f;
25789 {
25790 velocity.X += 0.1f;
25791 }
25793 {
25794 velocity.X += 0.05f;
25795 }
25797 {
25799 }
25800 }
25807 {
25809 {
25810 continue;
25811 }
25813 {
25815 }
25817 {
25819 {
25821 }
25823 break;
25824 }
25825 }
25827 {
25828 velocity.Y += 0.05f;
25829 }
25830 else
25831 {
25832 velocity.Y -= 0.1f;
25833 }
25835 {
25836 velocity.Y -= 0.2f;
25837 }
25839 {
25841 }
25843 {
25845 }
25846 }
25848 {
25851 {
25852 velocity.Y *= 0.95f;
25853 }
25854 velocity.Y -= 0.5f;
25856 {
25858 }
25860 }
25861 }
25863 {
25864 bool flag30 =
type == 341 && !Main.snowMoon;
25865 if (this.ai[3] == 0
f)
25866 {
25868 if (
position.Y / 16
f > (
float)Main.UnderworldLayer)
25869 {
25871 }
25872 else if ((
double)(
position.Y / 16
f) > Main.worldSurface)
25873 {
25876 }
25877 else
25878 {
25880 }
25881 }
25883 {
25885 }
25886 if (this.ai[0] == 0
f)
25887 {
25889 {
25891 }
25892 if (Main.netMode == 1)
25893 {
25894 return;
25895 }
25897 {
25900 return;
25901 }
25906 {
25909 }
25910 }
25912 {
25915 if (this.ai[1] == 0
f)
25916 {
25918 }
25919 if (this.ai[2] < (
float)
num883)
25920 {
25921 velocity.X *= 0.9f;
25922 return;
25923 }
25926 {
25928 }
25930 {
25932 }
25935 if (this.ai[1] == 2
f)
25936 {
25940 }
25941 else
25942 {
25945 }
25947 }
25949 {
25950 velocity.X += 0.1f;
25951 }
25953 {
25954 velocity.X -= 0.1f;
25955 }
25956 }
25958 {
25960 }
25962 {
25964 {
25966 }
25968 {
25970 Main.wofDrawAreaBottom = -1;
25971 Main.wofDrawAreaTop = -1;
25972 }
25973 if (Main.getGoodWorld && Main.netMode != 1 && Main.rand.Next(180) == 0 &&
CountNPCS(24) < 4)
25974 {
25977 {
25980 {
25984 {
25987 }
25988 num889 += Main.rand.Next(-50, 51);
25990 {
25991 }
25994 {
25996 if (Main.netMode == 2 &&
num891 < 200)
25997 {
25998 NetMessage.SendData(23, -1, -1,
null,
num891);
25999 }
26000 break;
26001 }
26002 }
26003 }
26004 }
26006 if (this.ai[2] == 0
f)
26007 {
26009 {
26011 }
26013 {
26015 }
26016 if (this.ai[1] > 2700
f)
26017 {
26019 }
26020 }
26022 if (this.ai[2] > 0
f && this.ai[1] > (
float)
num892)
26023 {
26026 {
26028 }
26031 if (this.ai[2] > (
float)
num893)
26032 {
26034 }
26035 if (Main.netMode != 1 &&
CountNPCS(117) < 10)
26036 {
26039 }
26040 }
26042 if (
localAI[3] >= (
float)(600 + Main.rand.Next(1000)))
26043 {
26044 localAI[3] = -Main.rand.Next(200);
26046 }
26047 int num895 = Main.UnderworldLayer + 10;
26049 Main.wofNPCIndex =
whoAmI;
26056 {
26058 if (
num902 > Main.maxTilesY - 10)
26059 {
26060 num902 = Main.maxTilesY - 10;
26061 break;
26062 }
26064 {
26065 continue;
26066 }
26068 {
26069 try
26070 {
26072 {
26074 }
26075 }
26076 catch
26077 {
26079 }
26080 }
26081 }
26083 if (Main.wofDrawAreaBottom == -1)
26084 {
26085 Main.wofDrawAreaBottom =
num902 * 16;
26086 }
26087 else if (Main.wofDrawAreaBottom >
num902 * 16)
26088 {
26089 Main.wofDrawAreaBottom--;
26090 if (Main.wofDrawAreaBottom <
num902 * 16)
26091 {
26092 Main.wofDrawAreaBottom =
num902 * 16;
26093 }
26094 }
26095 else if (Main.wofDrawAreaBottom <
num902 * 16)
26096 {
26097 Main.wofDrawAreaBottom++;
26098 if (Main.wofDrawAreaBottom >
num902 * 16)
26099 {
26100 Main.wofDrawAreaBottom =
num902 * 16;
26101 }
26102 }
26106 {
26109 {
26111 break;
26112 }
26114 {
26115 continue;
26116 }
26118 {
26120 break;
26121 }
26123 {
26124 try
26125 {
26127 {
26129 }
26130 }
26131 catch
26132 {
26134 }
26135 }
26136 }
26138 if (Main.wofDrawAreaTop == -1)
26139 {
26140 Main.wofDrawAreaTop =
num902 * 16;
26141 }
26142 else if (Main.wofDrawAreaTop >
num902 * 16)
26143 {
26144 Main.wofDrawAreaTop--;
26145 if (Main.wofDrawAreaTop <
num902 * 16)
26146 {
26147 Main.wofDrawAreaTop =
num902 * 16;
26148 }
26149 }
26150 else if (Main.wofDrawAreaTop <
num902 * 16)
26151 {
26152 Main.wofDrawAreaTop++;
26153 if (Main.wofDrawAreaTop >
num902 * 16)
26154 {
26155 Main.wofDrawAreaTop =
num902 * 16;
26156 }
26157 }
26158 Main.wofDrawAreaTop = (int)
MathHelper.Clamp((
float)Main.wofDrawAreaTop, (float)
num895 * 16
f, (
float)
num897 * 16
f);
26159 Main.wofDrawAreaBottom = (int)
MathHelper.Clamp((
float)Main.wofDrawAreaBottom, (float)
num895 * 16
f, (
float)
num897 * 16
f);
26160 if (Main.wofDrawAreaTop > Main.wofDrawAreaBottom - 160)
26161 {
26162 Main.wofDrawAreaTop = Main.wofDrawAreaBottom - 160;
26163 }
26164 else if (Main.wofDrawAreaBottom < Main.wofDrawAreaTop + 160)
26165 {
26166 Main.wofDrawAreaBottom = Main.wofDrawAreaTop + 160;
26167 }
26168 float num905 = (Main.wofDrawAreaBottom + Main.wofDrawAreaTop) / 2 -
height / 2;
26170 {
26172 }
26174 {
26176 }
26181 {
26183 }
26185 {
26187 }
26189 {
26191 }
26193 {
26195 }
26196 if ((
double)
life < (double)
lifeMax * 0.66 && Main.expertMode)
26197 {
26199 }
26200 if ((
double)
life < (double)
lifeMax * 0.33 && Main.expertMode)
26201 {
26203 }
26204 if ((
double)
life < (double)
lifeMax * 0.05 && Main.expertMode)
26205 {
26207 }
26208 if ((
double)
life < (double)
lifeMax * 0.035 && Main.expertMode)
26209 {
26211 }
26212 if ((
double)
life < (double)
lifeMax * 0.025 && Main.expertMode)
26213 {
26215 }
26216 if (Main.expertMode)
26217 {
26220 }
26221 if (Main.getGoodWorld)
26222 {
26225 }
26227 {
26229 if (Main.player[
target].dead)
26230 {
26231 float num908 =
float.PositiveInfinity;
26234 {
26236 if (player.active)
26237 {
26240 {
26242 num909 = ((base.Center.X < player.Center.X) ? 1 : (-1));
26243 }
26244 }
26245 }
26247 }
26249 }
26251 {
26254 }
26255 else
26256 {
26259 }
26260 if (Main.player[
target].dead || !Main.player[
target].gross)
26261 {
26263 }
26264 if (Main.player[
target].dead)
26265 {
26268 {
26272 if (Main.netMode != 1)
26273 {
26274 NetMessage.SendData(28, -1, -1,
null,
whoAmI, -1
f);
26275 }
26276 return;
26277 }
26278 }
26279 else
26280 {
26282 }
26293 {
26295 {
26297 }
26298 else
26299 {
26301 }
26302 }
26304 {
26306 }
26307 else
26308 {
26310 }
26311 if (Main.expertMode && Main.netMode != 1)
26312 {
26316 {
26318 }
26320 {
26322 }
26324 {
26326 }
26328 if (Main.rand.Next(
num916) == 0)
26329 {
26331 float[] array = new float[10];
26333 {
26335 {
26338 }
26339 }
26342 {
26345 {
26346 int num922 = Main.rand.Next(10);
26350 {
26352 {
26354 break;
26355 }
26356 }
26358 {
26360 break;
26361 }
26362 }
26364 {
26366 }
26367 }
26368 }
26369 }
26370 if (Main.netMode != 1 &&
localAI[0] == 1
f)
26371 {
26373 float num925 = (base.Center.Y + (float)Main.wofDrawAreaTop) / 2
f;
26375 float num927 = (base.Center.Y + (float)Main.wofDrawAreaBottom) / 2
f;
26377 float num928 = (base.Center.Y + (float)Main.wofDrawAreaBottom) / 2
f;
26379 {
26381 }
26382 }
26383 }
26385 {
26386 if (Main.wofNPCIndex < 0)
26387 {
26389 return;
26390 }
26392 if (Main.npc[Main.wofNPCIndex].life > 0)
26393 {
26394 life = Main.npc[Main.wofNPCIndex].life;
26395 }
26397 position.X = Main.npc[Main.wofNPCIndex].position.X;
26398 direction = Main.npc[Main.wofNPCIndex].direction;
26400 float num931 = (Main.wofDrawAreaBottom + Main.wofDrawAreaTop) / 2;
26401 num931 = ((!(this.ai[0] > 0
f)) ? ((
num931 + (float)Main.wofDrawAreaBottom) / 2
f) : ((
num931 + (float)Main.wofDrawAreaTop) / 2
f));
26404 {
26406 }
26408 {
26410 }
26411 else
26412 {
26415 }
26417 {
26419 }
26421 {
26423 }
26434 {
26436 {
26438 }
26439 else
26440 {
26443 }
26444 }
26446 {
26448 }
26449 else
26450 {
26453 }
26454 if (Main.netMode == 1)
26455 {
26456 return;
26457 }
26460 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.75)
26461 {
26464 }
26465 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.5)
26466 {
26469 }
26470 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.25)
26471 {
26474 }
26475 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.1)
26476 {
26479 }
26480 if (Main.expertMode)
26481 {
26484 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.1)
26485 {
26488 }
26489 }
26491 {
26493 {
26496 }
26497 }
26498 else
26499 {
26501 {
26502 return;
26503 }
26507 {
26509 }
26511 {
26515 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.5)
26516 {
26519 }
26520 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.25)
26521 {
26524 }
26525 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.1)
26526 {
26529 }
26540 }
26541 }
26542 }
26544 {
26546 {
26548 }
26549 if (Main.wofNPCIndex < 0)
26550 {
26552 return;
26553 }
26559 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.5)
26560 {
26563 if (!Main.expertMode)
26564 {
26566 }
26567 else
26568 {
26570 }
26571 }
26572 else if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.75)
26573 {
26576 if (!Main.expertMode)
26577 {
26579 }
26580 else
26581 {
26583 }
26584 }
26586 {
26588 }
26589 if (Main.expertMode)
26590 {
26593 {
26595 }
26597 {
26599 }
26601 {
26603 }
26605 {
26607 }
26609 {
26611 }
26613 }
26614 float num946 = Main.npc[Main.wofNPCIndex].position.X + (float)(Main.npc[Main.wofNPCIndex].width / 2);
26615 float y3 = Main.npc[Main.wofNPCIndex].position.Y;
26616 float num947 = Main.wofDrawAreaBottom - Main.wofDrawAreaTop;
26617 y3 = (float)Main.wofDrawAreaTop +
num947 *
this.ai[0];
26619 if (this.ai[2] > 100
f)
26620 {
26622 if (this.ai[2] > 200
f)
26623 {
26625 }
26626 }
26632 if (this.ai[1] == 0
f)
26633 {
26635 {
26639 }
26641 {
26644 {
26645 velocity.X +=
num943 * 2.5f;
26646 }
26647 }
26649 {
26652 {
26653 velocity.X -=
num943 * 2.5f;
26654 }
26655 }
26657 {
26660 {
26661 velocity.Y +=
num943 * 2.5f;
26662 }
26663 }
26665 {
26668 {
26669 velocity.Y -=
num943 * 2.5f;
26670 }
26671 }
26673 if (Main.expertMode && Main.wofNPCIndex >= 0)
26674 {
26676 float num954 = Main.npc[Main.wofNPCIndex].life / Main.npc[Main.wofNPCIndex].lifeMax;
26677 if ((
double)
num954 < 0.75)
26678 {
26680 }
26681 if ((
double)
num954 < 0.5)
26682 {
26684 }
26685 if ((
double)
num954 < 0.25)
26686 {
26688 }
26689 if ((
double)
num954 < 0.1)
26690 {
26692 }
26696 if (
base.Center.X < Main.npc[Main.wofNPCIndex].Center.X && Main.npc[Main.wofNPCIndex].velocity.X > 0
f)
26697 {
26699 }
26700 if (
base.Center.X > Main.npc[Main.wofNPCIndex].Center.X && Main.npc[Main.wofNPCIndex].velocity.X < 0
f)
26701 {
26703 }
26704 }
26706 {
26708 }
26710 {
26712 }
26714 {
26716 }
26718 {
26720 }
26721 }
26722 else if (this.ai[1] > 0
f)
26723 {
26725 }
26726 else
26727 {
26729 }
26731 {
26734 }
26736 {
26739 }
26740 Lighting.AddLight((
int)(position.X + (float)(
width / 2)) / 16, (
int)(position.Y + (float)(
height / 2)) / 16, 0.3
f, 0.2
f, 0.1
f);
26741 }
26743 {
26745 {
26747 }
26749 float num955 = position.X + (float)(
width / 2) - Main.player[
target].position.X - (float)(Main.player[
target].width / 2);
26750 float num956 = position.Y + (float)
height - 59
f - Main.player[
target].position.Y - (
float)(Main.player[
target].height / 2);
26753 {
26755 }
26756 else if ((
double)
num957 > 6.283)
26757 {
26759 }
26762 {
26764 {
26766 }
26767 else
26768 {
26770 }
26771 }
26773 {
26775 {
26777 }
26778 else
26779 {
26781 }
26782 }
26784 {
26786 }
26788 {
26790 }
26791 else if ((
double)
rotation > 6.283)
26792 {
26794 }
26796 {
26798 }
26799 if (Main.rand.Next(5) == 0)
26800 {
26807 Main.dust[
num959].velocity.X *= 0.5f;
26808 Main.dust[
num959].velocity.Y *= 0.1f;
26809 }
26810 if (Main.netMode != 1 && !Main.IsItDay() && !
dead2 &&
timeLeft < 10)
26811 {
26813 {
26815 {
26817 }
26818 }
26819 }
26822 {
26828 float num961 = nPC.velocity.X * 0.025f;
26831 }
26833 if (Main.IsItDay() ||
dead2)
26834 {
26835 velocity.Y -= 0.04f;
26837 return;
26838 }
26839 if (this.ai[0] == 0
f)
26840 {
26841 if (this.ai[1] == 0
f)
26842 {
26845 if (Main.expertMode)
26846 {
26849 }
26850 if (Main.getGoodWorld)
26851 {
26854 }
26857 {
26859 }
26865 {
26871 }
26875 {
26877 {
26881 }
26885 }
26886 else
26887 {
26892 {
26895 {
26897 }
26898 }
26900 {
26903 {
26905 }
26906 }
26908 {
26911 {
26913 }
26914 }
26916 {
26919 {
26921 }
26922 }
26923 }
26927 {
26930 }
26932 if (this.ai[2] >= (
float)
num971)
26933 {
26939 }
26941 {
26942 if (!Main.player[
target].dead)
26943 {
26945 if (Main.expertMode && (
double)
life < (
double)
lifeMax * 0.9)
26946 {
26947 this.ai[3] += 0.3f;
26948 }
26949 if (Main.expertMode && (
double)
life < (
double)
lifeMax * 0.8)
26950 {
26951 this.ai[3] += 0.3f;
26952 }
26953 if (Main.expertMode && (
double)
life < (
double)
lifeMax * 0.7)
26954 {
26955 this.ai[3] += 0.3f;
26956 }
26957 if (Main.expertMode && (
double)
life < (
double)
lifeMax * 0.6)
26958 {
26959 this.ai[3] += 0.3f;
26960 }
26961 if (Main.getGoodWorld)
26962 {
26963 this.ai[3] += 0.5f;
26964 }
26965 }
26966 if (this.ai[3] >= (
float)
num972)
26967 {
26972 if (Main.netMode != 1)
26973 {
26977 if (Main.expertMode)
26978 {
26980 }
26985 num966 += (float)Main.rand.Next(-40, 41) * 0.08f;
26986 num967 += (float)Main.rand.Next(-40, 41) * 0.08f;
26990 }
26991 }
26992 }
26993 }
26994 else if (this.ai[1] == 1
f)
26995 {
26998 if (Main.expertMode)
26999 {
27001 }
27002 if (Main.getGoodWorld)
27003 {
27005 }
27015 }
27016 else if (this.ai[1] == 2
f)
27017 {
27019 if (this.ai[2] >= 25
f)
27020 {
27021 velocity.X *= 0.96f;
27022 velocity.Y *= 0.96f;
27023 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
27024 {
27026 }
27027 if ((
double)velocity.Y > -0.1 && (double)
velocity.Y < 0.1)
27028 {
27030 }
27031 }
27032 else
27033 {
27035 }
27036 if (this.ai[2] >= 70
f)
27037 {
27042 if (this.ai[3] >= 4
f)
27043 {
27046 }
27047 else
27048 {
27050 }
27051 }
27052 }
27054 {
27060 }
27061 return;
27062 }
27063 if (this.ai[0] == 1
f || this.ai[0] == 2
f)
27064 {
27066 {
27068 }
27069 if (this.ai[0] == 1
f)
27070 {
27071 this.ai[2] += 0.005f;
27072 if ((double)this.ai[2] > 0.5)
27073 {
27074 this.ai[2] = 0.5f;
27075 }
27076 }
27077 else
27078 {
27079 this.ai[2] -= 0.005f;
27080 if (this.ai[2] < 0
f)
27081 {
27083 }
27084 }
27087 if (this.ai[1] >= 100
f)
27088 {
27091 if (this.ai[0] == 3
f)
27092 {
27094 }
27095 else
27096 {
27099 {
27100 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 143);
27101 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 7);
27102 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 6);
27103 }
27105 {
27109 float speedX17 = (float)Main.rand.Next(-30, 31) * 0.2f;
27110 float speedY16 = (float)Main.rand.Next(-30, 31) * 0.2f;
27113 }
27115 }
27116 }
27120 float speedX18 = (float)Main.rand.Next(-30, 31) * 0.2f;
27121 float speedY17 = (float)Main.rand.Next(-30, 31) * 0.2f;
27124 velocity.X *= 0.98f;
27125 velocity.Y *= 0.98f;
27126 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
27127 {
27129 }
27130 if ((
double)velocity.Y > -0.1 && (double)
velocity.Y < 0.1)
27131 {
27133 }
27134 return;
27135 }
27139 if (this.ai[1] == 0
f)
27140 {
27143 if (Main.expertMode)
27144 {
27147 }
27148 if (Main.getGoodWorld)
27149 {
27152 }
27158 {
27164 }
27167 {
27169 {
27173 }
27174 velocity.X = (velocity.X * 4
f +
num986) / 5
f;
27175 velocity.Y = (velocity.Y * 4
f +
num987) / 5
f;
27176 }
27177 else
27178 {
27183 {
27186 {
27188 }
27189 }
27191 {
27194 {
27196 }
27197 }
27199 {
27202 {
27204 }
27205 }
27207 {
27210 {
27212 }
27213 }
27214 }
27217 {
27219 }
27221 if (this.ai[2] >= (
float)
num989)
27222 {
27228 }
27233 if (Main.netMode == 1)
27234 {
27235 return;
27236 }
27239 {
27241 }
27243 {
27245 }
27247 {
27249 }
27251 {
27253 }
27255 {
27260 if (Main.expertMode)
27261 {
27263 }
27271 }
27272 return;
27273 }
27276 {
27278 }
27281 if (Main.expertMode)
27282 {
27285 }
27286 if (Main.getGoodWorld)
27287 {
27290 }
27300 {
27303 {
27305 }
27306 }
27308 {
27311 {
27313 }
27314 }
27316 {
27319 {
27321 }
27322 }
27324 {
27327 {
27329 }
27330 }
27335 if (Main.netMode != 1)
27336 {
27339 {
27341 }
27343 {
27345 }
27347 {
27349 }
27351 {
27353 }
27354 if (Main.expertMode)
27355 {
27357 }
27359 {
27371 }
27372 }
27374 if (this.ai[2] >= 180
f)
27375 {
27381 }
27382 }
27384 {
27386 {
27388 }
27390 float num1003 = position.X + (float)(
width / 2) - Main.player[
target].position.X - (float)(Main.player[
target].width / 2);
27391 float num1004 = position.Y + (float)
height - 59
f - Main.player[
target].position.Y - (
float)(Main.player[
target].height / 2);
27394 {
27396 }
27397 else if ((
double)
num1005 > 6.283)
27398 {
27400 }
27403 {
27405 }
27407 {
27409 {
27411 }
27412 else
27413 {
27415 }
27416 }
27418 {
27420 {
27422 }
27423 else
27424 {
27426 }
27427 }
27429 {
27431 }
27433 {
27435 }
27436 else if ((
double)
rotation > 6.283)
27437 {
27439 }
27441 {
27443 }
27444 if (Main.rand.Next(5) == 0)
27445 {
27452 Main.dust[
num1008].velocity.X *= 0.5f;
27453 Main.dust[
num1008].velocity.Y *= 0.1f;
27454 }
27455 if (Main.netMode != 1 && !Main.IsItDay() && !
dead3 &&
timeLeft < 10)
27456 {
27458 {
27460 {
27462 }
27463 }
27464 }
27467 {
27473 float num1010 = nPC5.velocity.X * 0.025f;
27476 }
27478 if (Main.IsItDay() ||
dead3)
27479 {
27480 velocity.Y -= 0.04f;
27482 return;
27483 }
27484 if (this.ai[0] == 0
f)
27485 {
27486 if (this.ai[1] == 0
f)
27487 {
27491 if (Main.getGoodWorld)
27492 {
27495 }
27498 {
27500 }
27506 {
27512 }
27516 {
27518 {
27522 }
27523 velocity.X = (velocity.X * 4
f +
num1014) / 5
f;
27524 velocity.Y = (velocity.Y * 4
f +
num1015) / 5
f;
27525 }
27526 else
27527 {
27532 {
27535 {
27537 }
27538 }
27540 {
27543 {
27545 }
27546 }
27548 {
27551 {
27553 }
27554 }
27556 {
27559 {
27561 }
27562 }
27563 }
27566 {
27568 }
27570 if (this.ai[2] >= (
float)
num1019)
27571 {
27577 }
27578 else
27579 {
27580 if (!Main.player[
target].dead)
27581 {
27583 if (Main.expertMode && (
double)
life < (double)
lifeMax * 0.8)
27584 {
27585 this.ai[3] += 0.6f;
27586 }
27587 if (Main.getGoodWorld)
27588 {
27589 this.ai[3] += 0.4f;
27590 }
27591 }
27592 if (this.ai[3] >= 60
f)
27593 {
27598 if (Main.netMode != 1)
27599 {
27603 if (Main.expertMode)
27604 {
27606 }
27611 num1014 += (float)Main.rand.Next(-40, 41) * 0.05f;
27612 num1015 += (float)Main.rand.Next(-40, 41) * 0.05f;
27616 }
27617 }
27618 }
27619 }
27620 else if (this.ai[1] == 1
f)
27621 {
27624 if (Main.expertMode)
27625 {
27627 {
27629 }
27631 {
27633 }
27635 {
27637 }
27639 {
27641 }
27643 {
27645 }
27646 }
27647 if (Main.getGoodWorld)
27648 {
27650 }
27660 }
27661 else if (this.ai[1] == 2
f)
27662 {
27664 if (this.ai[2] >= 8
f)
27665 {
27666 velocity.X *= 0.9f;
27667 velocity.Y *= 0.9f;
27668 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
27669 {
27671 }
27672 if ((
double)velocity.Y > -0.1 && (double)
velocity.Y < 0.1)
27673 {
27675 }
27676 }
27677 else
27678 {
27680 }
27681 if (this.ai[2] >= 42
f)
27682 {
27687 if (this.ai[3] >= 10
f)
27688 {
27691 }
27692 else
27693 {
27695 }
27696 }
27697 }
27699 {
27705 }
27706 return;
27707 }
27708 if (this.ai[0] == 1
f || this.ai[0] == 2
f)
27709 {
27711 {
27713 }
27714 if (this.ai[0] == 1
f)
27715 {
27716 this.ai[2] += 0.005f;
27717 if ((double)this.ai[2] > 0.5)
27718 {
27719 this.ai[2] = 0.5f;
27720 }
27721 }
27722 else
27723 {
27724 this.ai[2] -= 0.005f;
27725 if (this.ai[2] < 0
f)
27726 {
27728 }
27729 }
27732 if (this.ai[1] >= 100
f)
27733 {
27736 if (this.ai[0] == 3
f)
27737 {
27739 }
27740 else
27741 {
27744 {
27745 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 144);
27746 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 7);
27747 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 6);
27748 }
27750 {
27754 float speedX19 = (float)Main.rand.Next(-30, 31) * 0.2f;
27755 float speedY18 = (float)Main.rand.Next(-30, 31) * 0.2f;
27758 }
27760 }
27761 }
27765 float speedX20 = (float)Main.rand.Next(-30, 31) * 0.2f;
27766 float speedY19 = (float)Main.rand.Next(-30, 31) * 0.2f;
27769 velocity.X *= 0.98f;
27770 velocity.Y *= 0.98f;
27771 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
27772 {
27774 }
27775 if ((
double)velocity.Y > -0.1 && (double)
velocity.Y < 0.1)
27776 {
27778 }
27779 return;
27780 }
27784 if (this.ai[1] == 0
f)
27785 {
27790 {
27792 }
27799 {
27800 if (Main.expertMode)
27801 {
27803 {
27805 }
27807 {
27809 }
27811 {
27813 }
27815 {
27817 }
27819 {
27821 }
27823 {
27825 }
27826 }
27827 if (Main.getGoodWorld)
27828 {
27831 }
27836 {
27839 {
27841 }
27842 }
27844 {
27847 {
27849 }
27850 }
27852 {
27855 {
27857 }
27858 }
27860 {
27863 {
27865 }
27866 }
27867 }
27870 {
27872 }
27874 if (this.ai[2] >= (
float)
num1036)
27875 {
27881 }
27883 {
27886 {
27889 }
27890 if (Main.netMode != 1)
27891 {
27894 {
27896 }
27898 {
27900 }
27902 {
27904 }
27906 {
27908 }
27910 {
27922 num1034 += (float)Main.rand.Next(-40, 41) * 0.01f;
27923 num1033 += (float)Main.rand.Next(-40, 41) * 0.01f;
27924 num1034 += velocity.Y * 0.5f;
27925 num1033 += velocity.X * 0.5f;
27929 {
27934 }
27936 }
27937 }
27938 }
27940 {
27950 {
27954 }
27958 }
27959 }
27960 else if (this.ai[1] == 1
f)
27961 {
27965 if (Main.expertMode)
27966 {
27968 }
27978 }
27979 else
27980 {
27981 if (this.ai[1] != 2
f)
27982 {
27983 return;
27984 }
27986 if (Main.expertMode)
27987 {
27988 this.ai[2] += 0.5f;
27989 }
27990 if (this.ai[2] >= 50
f)
27991 {
27992 velocity.X *= 0.93f;
27993 velocity.Y *= 0.93f;
27994 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
27995 {
27997 }
27998 if ((
double)velocity.Y > -0.1 && (double)
velocity.Y < 0.1)
27999 {
28001 }
28002 }
28003 else
28004 {
28006 }
28007 if (this.ai[2] >= 80
f)
28008 {
28013 if (this.ai[3] >= 6
f)
28014 {
28017 }
28018 else
28019 {
28021 }
28022 }
28023 }
28024 }
28026 {
28029 if (this.ai[3] != 0
f)
28030 {
28032 }
28034 if (this.ai[0] == 0
f && Main.netMode != 1)
28035 {
28042 Main.npc[
num1046].netUpdate =
true;
28047 Main.npc[
num1046].netUpdate =
true;
28053 Main.npc[
num1046].netUpdate =
true;
28058 Main.npc[
num1046].netUpdate =
true;
28060 }
28062 {
28065 {
28067 }
28068 }
28069 if (Main.IsItDay() &&
this.ai[1] != 3
f &&
this.ai[1] != 2
f)
28070 {
28073 }
28074 if (this.ai[1] == 0
f)
28075 {
28077 if (this.ai[2] >= 600
f)
28078 {
28083 }
28085 {
28087 }
28088 else
28089 {
28091 }
28101 {
28105 }
28106 if (Main.expertMode)
28107 {
28112 }
28114 {
28116 {
28117 velocity.Y *= 0.98f;
28118 }
28121 {
28123 }
28124 }
28126 {
28128 {
28129 velocity.Y *= 0.98f;
28130 }
28133 {
28135 }
28136 }
28138 {
28140 {
28141 velocity.X *= 0.98f;
28142 }
28145 {
28147 }
28148 }
28150 {
28152 {
28153 velocity.X *= 0.98f;
28154 }
28157 {
28159 }
28160 }
28161 }
28162 else if (this.ai[1] == 1
f)
28163 {
28167 if (this.ai[2] == 2
f)
28168 {
28170 }
28171 if (this.ai[2] >= 400
f)
28172 {
28175 }
28177 {
28179 }
28180 else
28181 {
28183 }
28190 if (Main.expertMode)
28191 {
28194 {
28196 }
28198 {
28200 }
28202 {
28204 }
28206 {
28208 }
28210 {
28212 }
28214 {
28216 }
28218 {
28220 }
28222 {
28224 }
28226 {
28228 }
28230 {
28232 }
28233 }
28235 {
28238 }
28243 {
28246 {
28248 }
28250 {
28252 }
28253 }
28254 }
28255 else if (this.ai[1] == 2
f)
28256 {
28260 {
28262 }
28263 else
28264 {
28266 }
28275 {
28277 }
28279 {
28281 }
28285 }
28286 else
28287 {
28288 if (this.ai[1] != 3
f)
28289 {
28290 return;
28291 }
28293 {
28296 {
28297 Main.npc[
num1068].EncourageDespawn(5);
28298 }
28301 {
28302 Main.npc[
num1068].EncourageDespawn(5);
28303 }
28305 {
28308 {
28309 Main.npc[
num1068].Transform(136);
28310 }
28312 }
28313 velocity.Y += 0.1f;
28315 {
28316 velocity.Y *= 0.95f;
28317 }
28318 velocity.X *= 0.95f;
28320 {
28322 }
28323 }
28324 else
28325 {
28327 velocity.Y += 0.1f;
28329 {
28330 velocity.Y *= 0.95f;
28331 }
28332 velocity.X *= 0.95f;
28333 }
28334 }
28335 }
28337 {
28343 if (this.ai[2] != 99
f)
28344 {
28346 {
28348 }
28349 }
28351 {
28353 }
28355 if (!Main.npc[(
int)this.ai[1]].active || Main.npc[(int)this.ai[1]].
aiStyle != 32)
28356 {
28358 if (this.ai[2] > 50
f || Main.netMode != 2)
28359 {
28363 }
28364 }
28365 if (this.ai[2] == 99
f)
28366 {
28367 if (
position.Y > Main.npc[(
int)
this.ai[1]].position.Y)
28368 {
28370 {
28371 velocity.Y *= 0.96f;
28372 }
28373 velocity.Y -= 0.1f;
28375 {
28377 }
28378 }
28379 else if (
position.Y < Main.npc[(
int)
this.ai[1]].position.Y)
28380 {
28382 {
28383 velocity.Y *= 0.96f;
28384 }
28385 velocity.Y += 0.1f;
28387 {
28389 }
28390 }
28391 if (
position.X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2))
28392 {
28394 {
28395 velocity.X *= 0.96f;
28396 }
28397 velocity.X -= 0.5f;
28399 {
28401 }
28402 }
28403 if (
position.X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2))
28404 {
28406 {
28407 velocity.X *= 0.96f;
28408 }
28409 velocity.X += 0.5f;
28411 {
28413 }
28414 }
28415 }
28416 else if (this.ai[2] == 0
f || this.ai[2] == 3
f)
28417 {
28418 if (Main.npc[(
int)
this.ai[1]].ai[1] == 3
f)
28419 {
28421 }
28422 if (Main.npc[(
int)
this.ai[1]].ai[1] != 0
f)
28423 {
28425 if (Main.player[
target].dead)
28426 {
28427 velocity.Y += 0.1f;
28429 {
28431 }
28432 }
28433 else
28434 {
28445 {
28447 {
28448 velocity.X *= 0.97f;
28449 }
28450 velocity.X -= 0.05f;
28451 }
28453 {
28455 {
28456 velocity.X *= 0.97f;
28457 }
28458 velocity.X += 0.05f;
28459 }
28461 {
28463 {
28464 velocity.Y *= 0.97f;
28465 }
28466 velocity.Y -= 0.05f;
28467 }
28469 {
28471 {
28472 velocity.Y *= 0.97f;
28473 }
28474 velocity.Y += 0.05f;
28475 }
28476 }
28478 if (this.ai[3] >= 600
f)
28479 {
28483 }
28484 }
28485 else
28486 {
28488 if (this.ai[3] >= 300
f)
28489 {
28493 }
28494 if (
position.Y > Main.npc[(
int)this.ai[1]].position.Y + 320
f)
28495 {
28497 {
28498 velocity.Y *= 0.96f;
28499 }
28500 velocity.Y -= 0.04f;
28502 {
28504 }
28505 }
28506 else if (
position.Y < Main.npc[(
int)this.ai[1]].position.Y + 260
f)
28507 {
28509 {
28510 velocity.Y *= 0.96f;
28511 }
28512 velocity.Y += 0.04f;
28514 {
28516 }
28517 }
28518 if (
position.X + (
float)(
width / 2) > Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2))
28519 {
28521 {
28522 velocity.X *= 0.96f;
28523 }
28524 velocity.X -= 0.3f;
28526 {
28528 }
28529 }
28530 if (
position.X + (
float)(
width / 2) < Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2) - 250
f)
28531 {
28533 {
28534 velocity.X *= 0.96f;
28535 }
28536 velocity.X += 0.3f;
28538 {
28540 }
28541 }
28542 }
28549 }
28550 else if (this.ai[2] == 1
f)
28551 {
28558 velocity.X *= 0.95f;
28559 velocity.Y -= 0.1f;
28561 {
28563 }
28564 if (
position.Y < Main.npc[(
int)this.ai[1]].position.Y - 200
f)
28565 {
28576 }
28577 }
28578 else if (this.ai[2] == 2
f)
28579 {
28581 {
28583 }
28584 }
28585 else if (this.ai[2] == 4
f)
28586 {
28597 {
28599 {
28600 velocity.X *= 0.97f;
28601 }
28602 velocity.X -= 0.05f;
28603 }
28605 {
28607 {
28608 velocity.X *= 0.97f;
28609 }
28610 velocity.X += 0.05f;
28611 }
28613 {
28615 {
28616 velocity.Y *= 0.97f;
28617 }
28618 velocity.Y -= 0.05f;
28619 }
28621 {
28623 {
28624 velocity.Y *= 0.97f;
28625 }
28626 velocity.Y += 0.05f;
28627 }
28629 if (this.ai[3] >= 600
f)
28630 {
28634 }
28640 }
28641 else if (this.ai[2] == 5
f && ((
velocity.X > 0
f &&
position.X + (
float)(
width / 2) > Main.player[
target].position.X + (
float)(Main.player[
target].width / 2)) || (velocity.X < 0
f && position.X + (float)(
width / 2) < Main.player[
target].position.X + (float)(Main.player[
target].width / 2))))
28642 {
28644 }
28645 }
28647 {
28654 if (this.ai[2] != 99
f)
28655 {
28657 {
28659 }
28660 }
28662 {
28664 }
28665 if (!Main.npc[(
int)this.ai[1]].active || Main.npc[(int)this.ai[1]].
aiStyle != 32)
28666 {
28668 if (this.ai[2] > 50
f || Main.netMode != 2)
28669 {
28673 }
28674 }
28675 if (this.ai[2] == 99
f)
28676 {
28677 if (
position.Y > Main.npc[(
int)
this.ai[1]].position.Y)
28678 {
28680 {
28681 velocity.Y *= 0.96f;
28682 }
28683 velocity.Y -= 0.1f;
28685 {
28687 }
28688 }
28689 else if (
position.Y < Main.npc[(
int)
this.ai[1]].position.Y)
28690 {
28692 {
28693 velocity.Y *= 0.96f;
28694 }
28695 velocity.Y += 0.1f;
28697 {
28699 }
28700 }
28701 if (
position.X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2))
28702 {
28704 {
28705 velocity.X *= 0.96f;
28706 }
28707 velocity.X -= 0.5f;
28709 {
28711 }
28712 }
28713 if (
position.X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2))
28714 {
28716 {
28717 velocity.X *= 0.96f;
28718 }
28719 velocity.X += 0.5f;
28721 {
28723 }
28724 }
28725 }
28726 else if (this.ai[2] == 0
f || this.ai[2] == 3
f)
28727 {
28728 if (Main.npc[(
int)
this.ai[1]].ai[1] == 3
f)
28729 {
28731 }
28732 if (Main.npc[(
int)
this.ai[1]].ai[1] != 0
f)
28733 {
28736 if (Main.player[
target].dead)
28737 {
28738 velocity.Y += 0.1f;
28740 {
28742 }
28743 }
28744 else
28745 {
28756 {
28761 }
28762 else
28763 {
28765 }
28767 if (this.ai[3] >= 600
f)
28768 {
28772 }
28773 }
28774 }
28775 else
28776 {
28778 if (this.ai[3] >= 600
f)
28779 {
28783 }
28784 if (
position.Y > Main.npc[(
int)this.ai[1]].position.Y + 300
f)
28785 {
28787 {
28788 velocity.Y *= 0.96f;
28789 }
28790 velocity.Y -= 0.1f;
28792 {
28794 }
28795 }
28796 else if (
position.Y < Main.npc[(
int)this.ai[1]].position.Y + 230
f)
28797 {
28799 {
28800 velocity.Y *= 0.96f;
28801 }
28802 velocity.Y += 0.1f;
28804 {
28806 }
28807 }
28808 if (
position.X + (
float)(
width / 2) > Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2) + 250
f)
28809 {
28811 {
28812 velocity.X *= 0.94f;
28813 }
28814 velocity.X -= 0.3f;
28816 {
28818 }
28819 }
28820 if (
position.X + (
float)(
width / 2) < Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2))
28821 {
28823 {
28824 velocity.X *= 0.94f;
28825 }
28826 velocity.X += 0.2f;
28828 {
28830 }
28831 }
28832 }
28839 }
28840 else if (this.ai[2] == 1
f)
28841 {
28843 {
28844 velocity.Y *= 0.9f;
28845 }
28852 velocity.X = (velocity.X * 5
f + Main.npc[(int)this.ai[1]].
velocity.X) / 6
f;
28853 velocity.X += 0.5f;
28854 velocity.Y -= 0.5f;
28856 {
28858 }
28859 if (
position.Y < Main.npc[(
int)this.ai[1]].position.Y - 280
f)
28860 {
28871 }
28872 }
28873 else if (this.ai[2] == 2
f)
28874 {
28876 {
28877 if (this.ai[3] >= 4
f)
28878 {
28881 }
28882 else
28883 {
28886 }
28887 }
28888 }
28889 else if (this.ai[2] == 4
f)
28890 {
28897 velocity.Y = (velocity.Y * 5
f + Main.npc[(int)this.ai[1]].
velocity.Y) / 6
f;
28898 velocity.X += 0.5f;
28900 {
28902 }
28903 if (
position.X + (
float)(
width / 2) < Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2) - 500
f ||
position.X + (
float)(
width / 2) > Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2) + 500
f)
28904 {
28915 }
28916 }
28917 else if (this.ai[2] == 5
f &&
position.X + (
float)(
width / 2) < Main.player[
target].position.X + (
float)(Main.player[
target].width / 2) - 100
f)
28918 {
28919 if (this.ai[3] >= 4
f)
28920 {
28923 }
28924 else
28925 {
28928 }
28929 }
28930 }
28932 {
28934 if (!Main.npc[(
int)this.ai[1]].active || Main.npc[(int)this.ai[1]].
aiStyle != 32)
28935 {
28937 if (this.ai[2] > 50
f || Main.netMode != 2)
28938 {
28942 }
28943 }
28944 if (this.ai[2] == 0
f)
28945 {
28946 if (Main.npc[(
int)
this.ai[1]].ai[1] == 3
f)
28947 {
28949 }
28950 if (Main.npc[(
int)
this.ai[1]].ai[1] != 0
f)
28951 {
28953 if (
position.Y > Main.npc[(
int)
this.ai[1]].position.Y - 100
f)
28954 {
28956 {
28957 velocity.Y *= 0.96f;
28958 }
28959 velocity.Y -= 0.07f;
28961 {
28963 }
28964 }
28965 else if (
position.Y < Main.npc[(
int)
this.ai[1]].position.Y - 100
f)
28966 {
28968 {
28969 velocity.Y *= 0.96f;
28970 }
28971 velocity.Y += 0.07f;
28973 {
28975 }
28976 }
28977 if (
position.X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 120
f *
this.ai[0])
28978 {
28980 {
28981 velocity.X *= 0.96f;
28982 }
28983 velocity.X -= 0.1f;
28985 {
28987 }
28988 }
28989 if (
position.X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 120
f *
this.ai[0])
28990 {
28992 {
28993 velocity.X *= 0.96f;
28994 }
28995 velocity.X += 0.1f;
28997 {
28999 }
29000 }
29001 }
29002 else
29003 {
29005 if (this.ai[3] >= 1100
f)
29006 {
29011 }
29012 if (
position.Y > Main.npc[(
int)
this.ai[1]].position.Y - 150
f)
29013 {
29015 {
29016 velocity.Y *= 0.96f;
29017 }
29018 velocity.Y -= 0.04f;
29020 {
29022 }
29023 }
29024 else if (
position.Y < Main.npc[(
int)
this.ai[1]].position.Y - 150
f)
29025 {
29027 {
29028 velocity.Y *= 0.96f;
29029 }
29030 velocity.Y += 0.04f;
29032 {
29034 }
29035 }
29036 if (
position.X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) + 200
f)
29037 {
29039 {
29040 velocity.X *= 0.96f;
29041 }
29042 velocity.X -= 0.2f;
29044 {
29046 }
29047 }
29048 if (
position.X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) + 160
f)
29049 {
29051 {
29052 velocity.X *= 0.96f;
29053 }
29054 velocity.X += 0.2f;
29056 {
29058 }
29059 }
29060 }
29067 if (Main.netMode != 1)
29068 {
29071 {
29079 num1102 += (float)Main.rand.Next(-40, 41) * 0.01f;
29080 num1103 += (float)Main.rand.Next(-40, 41) * 0.01f;
29084 }
29085 }
29086 }
29087 else
29088 {
29089 if (this.ai[2] != 1
f)
29090 {
29091 return;
29092 }
29094 if (this.ai[3] >= 300
f)
29095 {
29100 }
29111 {
29113 {
29114 velocity.X *= 0.9f;
29115 }
29116 velocity.X -= 0.04f;
29117 }
29119 {
29121 {
29122 velocity.X *= 0.9f;
29123 }
29124 velocity.X += 0.04f;
29125 }
29127 {
29129 {
29130 velocity.Y *= 0.9f;
29131 }
29132 velocity.Y -= 0.08f;
29133 }
29135 {
29137 {
29138 velocity.Y *= 0.9f;
29139 }
29140 velocity.Y += 0.08f;
29141 }
29148 if (Main.netMode != 1)
29149 {
29152 {
29160 num1110 += (float)Main.rand.Next(-40, 41) * 0.01f;
29161 num1111 += (float)Main.rand.Next(-40, 41) * 0.01f;
29165 }
29166 }
29167 }
29168 }
29170 {
29172 if (!Main.npc[(
int)this.ai[1]].active || Main.npc[(int)this.ai[1]].
aiStyle != 32)
29173 {
29175 if (this.ai[2] > 50
f || Main.netMode != 2)
29176 {
29180 }
29181 }
29182 if (this.ai[2] == 0
f || this.ai[2] == 3
f)
29183 {
29184 if (Main.npc[(
int)
this.ai[1]].ai[1] == 3
f)
29185 {
29187 }
29188 if (Main.npc[(
int)
this.ai[1]].ai[1] != 0
f)
29189 {
29191 if (
position.Y > Main.npc[(
int)
this.ai[1]].position.Y - 100
f)
29192 {
29194 {
29195 velocity.Y *= 0.96f;
29196 }
29197 velocity.Y -= 0.07f;
29199 {
29201 }
29202 }
29203 else if (
position.Y < Main.npc[(
int)
this.ai[1]].position.Y - 100
f)
29204 {
29206 {
29207 velocity.Y *= 0.96f;
29208 }
29209 velocity.Y += 0.07f;
29211 {
29213 }
29214 }
29215 if (
position.X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 120
f *
this.ai[0])
29216 {
29218 {
29219 velocity.X *= 0.96f;
29220 }
29221 velocity.X -= 0.1f;
29223 {
29225 }
29226 }
29227 if (
position.X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 120
f *
this.ai[0])
29228 {
29230 {
29231 velocity.X *= 0.96f;
29232 }
29233 velocity.X += 0.1f;
29235 {
29237 }
29238 }
29239 }
29240 else
29241 {
29243 if (this.ai[3] >= 800
f)
29244 {
29248 }
29249 if (
position.Y > Main.npc[(
int)
this.ai[1]].position.Y - 100
f)
29250 {
29252 {
29253 velocity.Y *= 0.96f;
29254 }
29255 velocity.Y -= 0.1f;
29257 {
29259 }
29260 }
29261 else if (
position.Y < Main.npc[(
int)
this.ai[1]].position.Y - 100
f)
29262 {
29264 {
29265 velocity.Y *= 0.96f;
29266 }
29267 velocity.Y += 0.1f;
29269 {
29271 }
29272 }
29273 if (
position.X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 180
f *
this.ai[0])
29274 {
29276 {
29277 velocity.X *= 0.96f;
29278 }
29279 velocity.X -= 0.14f;
29281 {
29283 }
29284 }
29285 if (
position.X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 180
f *
this.ai[0])
29286 {
29288 {
29289 velocity.X *= 0.96f;
29290 }
29291 velocity.X += 0.14f;
29293 {
29295 }
29296 }
29297 }
29305 if (Main.netMode != 1)
29306 {
29309 {
29317 num1117 += (float)Main.rand.Next(-40, 41) * 0.05f;
29318 num1119 += (float)Main.rand.Next(-40, 41) * 0.05f;
29322 }
29323 }
29324 }
29325 else
29326 {
29327 if (this.ai[2] != 1
f)
29328 {
29329 return;
29330 }
29332 if (this.ai[3] >= 200
f)
29333 {
29338 }
29348 {
29350 {
29351 velocity.X *= 0.9f;
29352 }
29353 velocity.X -= 0.1f;
29354 }
29356 {
29358 {
29359 velocity.X *= 0.9f;
29360 }
29361 velocity.X += 0.1f;
29362 }
29364 {
29366 {
29367 velocity.Y *= 0.9f;
29368 }
29369 velocity.Y -= 0.03f;
29370 }
29372 {
29374 {
29375 velocity.Y *= 0.9f;
29376 }
29377 velocity.Y += 0.03f;
29378 }
29385 if (Main.netMode == 1)
29386 {
29389 {
29397 num1125 += (float)Main.rand.Next(-40, 41) * 0.05f;
29398 num1126 += (float)Main.rand.Next(-40, 41) * 0.05f;
29402 }
29403 }
29404 }
29405 }
29407 {
29409 }
29411 {
29415 {
29418 }
29420 {
29423 }
29425 {
29427 if (this.ai[2] >= 120
f)
29428 {
29430 if (Main.netMode != 1)
29431 {
29436 if (Main.netMode != 1)
29437 {
29441 Main.projectile[
num1137].ai[0] = 2
f;
29442 Main.projectile[
num1137].timeLeft = 300;
29443 Main.projectile[
num1137].friendly =
false;
29444 NetMessage.SendData(27, -1, -1,
null,
num1137);
29446 }
29447 }
29448 }
29449 }
29450 if (
type == 144 && this.ai[1] >= 3
f)
29451 {
29455 {
29456 velocity.X *= 0.9f;
29459 {
29461 }
29462 if (this.ai[2] >= 200
f)
29463 {
29466 }
29467 }
29468 }
29469 else if (
type == 145 && this.ai[1] >= 3
f)
29470 {
29473 {
29474 velocity.X *= 0.9f;
29477 {
29479 }
29480 if (this.ai[2] >= 16
f)
29481 {
29484 }
29485 }
29487 {
29497 if (Main.netMode != 1)
29498 {
29502 Main.projectile[
num1145].ai[0] = 2
f;
29503 Main.projectile[
num1145].timeLeft = 300;
29504 Main.projectile[
num1145].friendly =
false;
29505 NetMessage.SendData(27, -1, -1,
null,
num1145);
29507 }
29508 }
29509 }
29510 else
29511 {
29513 {
29515 {
29518 }
29520 if (this.ai[3] == 0
f)
29521 {
29523 }
29525 if (this.ai[0] > 2
f)
29526 {
29529 velocity.Y = -8.2f;
29531 }
29532 else
29533 {
29536 }
29538 }
29540 }
29541 if (this.ai[3] > 0
f)
29542 {
29544 }
29546 {
29548 }
29550 {
29552 }
29553 }
29555 {
29557 {
29559 }
29563 {
29565 }
29567 {
29569 }
29575 {
29583 {
29586 {
29588 }
29590 {
29592 }
29594 {
29597 {
29601 {
29603 }
29604 else
29605 {
29607 }
29608 }
29609 }
29610 }
29611 }
29613 {
29617 }
29619 {
29621 if (Main.rand.Next(10) == 0)
29622 {
29626 float speedX21 = velocity.X * 0.5f;
29627 float speedY20 = velocity.Y * 0.5f;
29630 Main.dust[
num1152].noGravity =
true;
29633 dust87.velocity *= 0.2f;
29634 }
29636 }
29637 if (this.ai[0] == 0
f)
29638 {
29640 {
29642 }
29644 {
29646 }
29655 {
29657 {
29659 }
29661 {
29663 }
29664 }
29665 else
29666 {
29668 {
29670 }
29672 {
29674 }
29676 {
29677 this.ai[1] = 1000
f;
29678 }
29679 }
29683 {
29684 knockBackResist = 0.75f * Main.GameModeInfo.KnockbackToEnemiesMultiplier;
29685 }
29686 else
29687 {
29688 knockBackResist = 0.3f * Main.GameModeInfo.KnockbackToEnemiesMultiplier;
29689 }
29691 if (this.ai[1] >= 400
f)
29692 {
29695 }
29697 {
29699 }
29701 {
29705 {
29706 num1156 = (int)(((
double)position.X + (double)
width * 0.5) / 16.0);
29708 }
29709 else
29710 {
29711 num1157 = (int)(((
double)position.X + (double)
width * 0.5) / 16.0);
29713 }
29718 {
29720 {
29722 {
29724 }
29725 }
29726 }
29728 {
29731 }
29732 }
29734 {
29737 {
29739 {
29741 }
29742 }
29744 {
29745 velocity.X += 0.07f;
29747 {
29749 }
29750 }
29752 {
29753 velocity.X -= 0.07f;
29755 {
29757 }
29758 }
29759 return;
29760 }
29763 {
29765 {
29767 {
29769 }
29770 }
29772 {
29773 velocity.X += 0.07f;
29775 {
29777 }
29778 }
29780 {
29781 velocity.X -= 0.07f;
29783 {
29785 }
29786 }
29787 }
29789 {
29791 {
29793 }
29794 }
29796 {
29797 velocity.X += 0.07f;
29799 {
29800 velocity.X = 1.5f;
29801 }
29802 }
29804 {
29805 velocity.X -= 0.07f;
29807 {
29808 velocity.X = -1.5f;
29809 }
29810 }
29811 }
29812 else if (this.ai[0] == 1
f)
29813 {
29814 velocity.X *= 0.5f;
29816 {
29817 this.ai[1] += 0.5f;
29818 }
29819 else
29820 {
29822 }
29823 if (this.ai[1] >= 30
f)
29824 {
29831 {
29836 this.ai[2] = Main.rand.Next(2, 5);
29837 }
29838 }
29839 }
29840 else if (this.ai[0] == 3
f)
29841 {
29842 if (
type == 154 && Main.rand.Next(3) < 2)
29843 {
29848 float speedX22 = velocity.X * 0.5f;
29849 float speedY21 = velocity.Y * 0.5f;
29852 Main.dust[
num1166].noGravity =
true;
29855 dust87.velocity *= 0.2f;
29857 }
29860 {
29862 }
29866 if (this.ai[1] == 1
f)
29867 {
29870 this.ai[2] += 0.3f;
29876 {
29878 }
29880 {
29882 }
29888 {
29890 }
29898 {
29900 }
29904 }
29905 else
29906 {
29908 {
29909 velocity.X *= 0.8f;
29912 {
29913 velocity.Y += 0.2f;
29914 }
29915 }
29916 if (this.ai[3] != 0
f)
29917 {
29918 velocity.X = this.ai[3];
29919 velocity.Y -= 0.22f;
29920 }
29921 if (this.ai[1] >= 90
f)
29922 {
29926 }
29927 }
29929 {
29930 velocity.Y -= 0.3f;
29931 }
29933 }
29934 else if (this.ai[0] == 4
f)
29935 {
29937 {
29938 velocity.Y -= 0.3f;
29939 }
29940 velocity.X *= 0.96f;
29941 if (this.ai[2] > 0
f)
29942 {
29943 this.ai[2] -= 0.01f;
29945 }
29947 {
29949 }
29951 {
29957 }
29958 }
29959 else if (this.ai[0] == 6
f)
29960 {
29964 if (Main.rand.Next(3) < 2)
29965 {
29967 Vector2
val49 = base.Center -
new Vector2(30
f);
29968 float speedX23 = velocity.X * 0.5f;
29969 float speedY22 = velocity.Y * 0.5f;
29972 Main.dust[
num1173].noGravity =
true;
29975 dust87.velocity *= 0.2f;
29978 }
29980 if (this.ai[3] > 0
f)
29981 {
29983 if (this.ai[3] == 1
f)
29984 {
29985 Vector2
vector291 = base.Center -
new Vector2(50
f);
29987 {
29990 Main.dust[
num1176].noGravity =
true;
29993 dust87.velocity *= 3
f;
29998 dust87.velocity *= 2
f;
29999 Main.dust[
num1176].noGravity =
true;
30000 }
30002 {
30003 Vector2
val50 =
vector291 +
new Vector2((
float)(50 * Main.rand.Next(100)) / 100
f, (
float)(50 * Main.rand.Next(100)) / 100
f) - Vector2.One * 10
f;
30004 val29 =
default(Vector2);
30006 Gore gore = Main.gore[
num1178];
30008 gore4.velocity *= 0.3f;
30009 Main.gore[
num1178].velocity.X += (float)Main.rand.Next(-10, 11) * 0.05f;
30010 Main.gore[
num1178].velocity.Y += (float)Main.rand.Next(-10, 11) * 0.05f;
30011 }
30012 }
30014 {
30020 Main.dust[
num1180].velocity = Main.dust[
num1180].velocity * Main.rand.NextFloat();
30021 }
30022 this.ai[3]++;
30023 if (this.ai[3] >= 10
f)
30024 {
30026 }
30028 }
30029 if (this.ai[1] == 1
f)
30030 {
30036 {
30038 }
30044 {
30046 }
30054 {
30056 }
30059 }
30060 else
30061 {
30063 {
30064 velocity.X *= 0.9f;
30066 {
30067 velocity.Y += 0.2f;
30068 }
30069 }
30070 if (this.ai[2] == 0
f || this.ai[1] >= 1200
f)
30071 {
30074 }
30075 }
30077 {
30078 velocity.Y -= 0.3f;
30079 }
30081 }
30082 else if (this.ai[0] == 5
f)
30083 {
30085 {
30089 }
30093 {
30094 this.ai[1] += 0.5f;
30095 }
30096 else
30097 {
30099 }
30100 if (this.ai[1] >= 30
f)
30101 {
30106 }
30108 {
30111 }
30112 }
30113 }
30115 {
30117 {
30119 }
30123 {
30126 }
30128 {
30131 }
30135 float num1190 = Main.player[
target].position.Y + (float)(Main.player[
target].height / 2);
30143 {
30146 }
30150 {
30153 }
30154 else
30155 {
30159 }
30160 if (Main.player[
target].dead)
30161 {
30164 }
30167 {
30169 if (this.ai[0] > 0
f)
30170 {
30171 velocity.Y += 0.023f;
30172 }
30173 else
30174 {
30175 velocity.Y -= 0.023f;
30176 }
30177 if (this.ai[0] < -100
f || this.ai[0] > 100
f)
30178 {
30179 velocity.X += 0.023f;
30180 }
30181 else
30182 {
30183 velocity.X -= 0.023f;
30184 }
30185 if (this.ai[0] > 200
f)
30186 {
30187 this.ai[0] = -200
f;
30188 }
30189 velocity.X +=
num1189 * 0.007f;
30190 velocity.Y +=
num1190 * 0.007f;
30192 if ((double)velocity.X > 1.5)
30193 {
30194 velocity.X *= 0.9f;
30195 }
30196 if ((double)velocity.X < -1.5)
30197 {
30198 velocity.X *= 0.9f;
30199 }
30200 if ((double)velocity.Y > 1.5)
30201 {
30202 velocity.Y *= 0.9f;
30203 }
30204 if ((double)velocity.Y < -1.5)
30205 {
30206 velocity.Y *= 0.9f;
30207 }
30209 {
30211 }
30213 {
30215 }
30217 {
30219 }
30221 {
30223 }
30224 }
30225 else
30226 {
30228 {
30231 {
30233 }
30234 }
30236 {
30239 {
30241 }
30242 }
30244 {
30247 {
30249 }
30250 }
30252 {
30255 {
30257 }
30258 }
30260 }
30262 {
30264 }
30267 {
30269 velocity.X = oldVelocity.X * (0
f -
num1193);
30271 {
30273 }
30275 {
30277 }
30278 }
30280 {
30282 velocity.Y = oldVelocity.Y * (0
f -
num1193);
30283 if (
velocity.Y > 0
f && (
double)velocity.Y < 1.5)
30284 {
30286 }
30287 if (
velocity.Y < 0
f && (
double)velocity.Y > -1.5)
30288 {
30290 }
30291 }
30293 {
30295 }
30296 if (Main.netMode == 1)
30297 {
30298 return;
30299 }
30300 if (Main.netMode != 1 && Main.expertMode &&
target >= 0 && (
type == 163 ||
type == 238 ||
type == 236 ||
type == 237) && Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
30301 {
30304 {
30305 localAI[0] -= Main.rand.Next(20, 60);
30307 {
30309 }
30310 }
30311 if (
localAI[0] > (
float)Main.rand.Next(180, 900))
30312 {
30319 }
30320 }
30322 {
30325 {
30326 case 165:
30328 break;
30329 case 237:
30331 break;
30332 case 238:
30334 break;
30335 case 240:
30337 break;
30338 case 531:
30340 break;
30341 }
30343 }
30344 }
30346 {
30347 if (this.ai[2] > 1
f)
30348 {
30350 }
30351 if (this.ai[2] == 0
f)
30352 {
30353 this.ai[0] = -100
f;
30357 }
30359 {
30363 if (this.ai[1] != 5
f && Main.rand.Next(3) == 0)
30364 {
30369 Main.dust[
num1195].scale = 1.5f;
30370 Main.dust[
num1195].noGravity =
true;
30375 val29 =
default(Vector2);
30378 }
30379 if (this.ai[1] == 5
f)
30380 {
30382 position.X +=
width / 2;
30383 position.Y +=
height / 2;
30386 position.X -=
width / 2;
30387 position.Y -=
height / 2;
30390 if (this.ai[2] > 7
f)
30391 {
30393 {
30399 }
30401 {
30407 Main.dust[
num1200].noGravity =
true;
30410 dust87.velocity *= 3
f;
30418 dust87.velocity *= 2
f;
30419 Main.dust[
num1200].noGravity =
true;
30420 }
30422 {
30423 Vector2
val56 =
position +
new Vector2((
float)(
width * Main.rand.Next(100)) / 100
f, (
float)(
height * Main.rand.Next(100)) / 100
f) - Vector2.One * 10
f;
30424 val29 =
default(Vector2);
30428 gore4.velocity *= 0.3f;
30429 Main.gore[
num1202].velocity.X += (float)Main.rand.Next(-10, 11) * 0.05f;
30430 Main.gore[
num1202].velocity.Y += (float)Main.rand.Next(-10, 11) * 0.05f;
30431 }
30432 if (this.ai[2] == 9
f)
30433 {
30435 }
30436 }
30437 if (this.ai[2] == 1
f)
30438 {
30442 }
30444 return;
30445 }
30446 }
30447 if (
type == 378 && this.ai[1] != 5
f)
30448 {
30449 if (
wet || Vector2.Distance(
base.Center, Main.player[
target].Center) < 64
f)
30450 {
30454 return;
30455 }
30456 }
30458 {
30460 {
30463 }
30465 {
30468 {
30470 }
30471 else
30472 {
30474 }
30476 }
30478 {
30479 velocity.Y *= 0.95f;
30480 }
30481 velocity.Y -= 0.3f;
30483 {
30485 }
30486 }
30488 {
30490 {
30493 }
30495 velocity.X *= 0.8f;
30497 {
30499 }
30501 {
30503 }
30504 else
30505 {
30507 }
30516 {
30518 }
30520 if (this.ai[0] >= 0
f)
30521 {
30523 if (this.ai[2] == 1
f)
30524 {
30526 }
30528 {
30529 if (this.ai[1] == 2
f)
30530 {
30531 velocity.Y = -11.5f;
30534 {
30536 }
30537 this.ai[0] = -200
f;
30540 }
30541 else
30542 {
30543 velocity.Y = -7.5f;
30546 {
30548 }
30549 this.ai[0] = -120
f;
30551 }
30552 }
30553 else
30554 {
30556 {
30558 }
30559 if (this.ai[1] == 3
f)
30560 {
30564 {
30566 }
30567 this.ai[0] = -200
f;
30570 }
30571 else
30572 {
30576 {
30578 }
30579 this.ai[0] = -120
f;
30581 }
30582 }
30583 }
30584 else if (this.ai[0] >= -30
f)
30585 {
30587 }
30589 }
30590 else
30591 {
30593 {
30594 return;
30595 }
30597 {
30600 {
30602 velocity.X *= 0.92f;
30604 {
30605 velocity.Y *= 0.9f;
30606 velocity.Y += 0.1f;
30607 }
30608 }
30610 {
30612 {
30614 }
30615 else
30616 {
30617 velocity.X *= 0.93f;
30618 }
30619 }
30620 }
30622 {
30624 {
30626 }
30627 else
30628 {
30629 velocity.X *= 0.93f;
30630 }
30631 }
30632 }
30633 }
30635 {
30637 if (this.ai[0] == 0
f)
30638 {
30640 {
30647 {
30649 }
30650 }
30652 {
30654 }
30655 }
30656 else
30657 {
30659 if (this.ai[0] >= 21
f)
30660 {
30663 }
30664 }
30665 }
30667 {
30668 if (Main.expertMode)
30669 {
30672 }
30674 {
30676 }
30679 if ((
double)(
position.Y / 16
f) < Main.worldSurface)
30680 {
30682 }
30683 if (!Main.player[
target].ZoneJungle)
30684 {
30686 }
30687 if (Main.getGoodWorld)
30688 {
30690 }
30692 if (this.ai[0] != 5
f)
30693 {
30695 {
30697 }
30699 {
30702 }
30703 }
30705 {
30708 }
30709 if (this.ai[0] == 5
f)
30710 {
30711 velocity.Y *= 0.98f;
30713 {
30715 }
30716 else
30717 {
30719 }
30721 if (
position.X < (
float)(Main.maxTilesX * 8))
30722 {
30724 {
30725 velocity.X *= 0.98f;
30726 }
30727 else
30728 {
30730 }
30731 velocity.X -= 0.08f;
30732 }
30733 else
30734 {
30736 {
30737 velocity.X *= 0.98f;
30738 }
30739 else
30740 {
30742 }
30743 velocity.X += 0.08f;
30744 }
30746 }
30747 else if (this.ai[0] == -1
f)
30748 {
30749 if (Main.netMode == 1)
30750 {
30751 return;
30752 }
30755 do
30756 {
30759 {
30760 case 1:
30762 break;
30763 case 2:
30765 break;
30766 }
30767 }
30773 }
30774 else if (this.ai[0] == 0
f)
30775 {
30777 if (Main.expertMode)
30778 {
30780 {
30782 }
30784 {
30786 }
30788 {
30790 }
30791 }
30793 if (this.ai[1] > (
float)(2 *
num1216) && this.ai[1] % 2
f == 0
f)
30794 {
30799 return;
30800 }
30801 if (this.ai[1] % 2
f == 0
f)
30802 {
30807 {
30813 if (Main.expertMode)
30814 {
30817 {
30819 }
30821 {
30823 }
30825 {
30827 }
30829 {
30831 }
30832 }
30844 return;
30845 }
30849 if (Main.expertMode)
30850 {
30852 {
30855 }
30857 {
30860 }
30862 {
30865 }
30867 {
30870 }
30871 }
30875 {
30877 }
30878 else
30879 {
30881 }
30883 {
30885 }
30887 {
30889 }
30891 {
30892 velocity.X += 0.15f * (float)
direction;
30893 }
30895 {
30896 velocity.X -= 0.15f * (float)
direction;
30897 }
30898 else
30899 {
30900 velocity.X *= 0.8f;
30901 }
30903 {
30905 }
30907 {
30909 }
30911 return;
30912 }
30914 {
30916 }
30917 else
30918 {
30920 }
30923 if (Main.expertMode)
30924 {
30926 {
30928 }
30930 {
30932 }
30934 {
30936 }
30938 {
30940 }
30941 }
30944 {
30946 }
30950 {
30953 }
30955 {
30958 }
30960 {
30962 }
30963 if (this.ai[2] == 1
f)
30964 {
30970 if (Main.expertMode)
30971 {
30973 {
30976 }
30978 {
30981 }
30983 {
30986 }
30987 }
30989 {
30991 }
30993 {
30997 }
30998 }
30999 else
31000 {
31002 }
31003 }
31004 else if (this.ai[0] == 2
f)
31005 {
31010 if (Main.expertMode)
31011 {
31013 }
31020 {
31024 return;
31025 }
31028 {
31031 {
31033 }
31034 }
31036 {
31039 {
31041 }
31042 }
31044 {
31047 {
31049 }
31050 }
31052 {
31055 {
31057 }
31058 }
31059 }
31060 else if (this.ai[0] == 1
f)
31061 {
31072 if (Main.expertMode)
31073 {
31076 {
31078 {
31080 if (((Vector2)(
ref val29)).Length() < 1000
f)
31081 {
31083 }
31084 }
31085 }
31088 {
31089 this.ai[1] += 0.25f;
31090 }
31092 {
31093 this.ai[1] += 0.25f;
31094 }
31096 {
31097 this.ai[1] += 0.25f;
31098 }
31100 {
31101 this.ai[1] += 0.25f;
31102 }
31103 }
31106 if (this.ai[1] > (
float)
num1239)
31107 {
31109 this.ai[2]++;
31111 }
31113 {
31115 if (Main.netMode != 1)
31116 {
31117 int num1241 = Main.rand.Next(210, 212);
31123 nPC23.velocity *= 5
f;
31124 Main.npc[
num1242].CanBeReplacedByOtherNPCs =
true;
31125 Main.npc[
num1242].localAI[0] = 60
f;
31126 Main.npc[
num1242].netUpdate =
true;
31127 }
31128 }
31130 {
31139 {
31142 {
31144 }
31145 }
31147 {
31150 {
31152 }
31153 }
31155 {
31158 {
31160 }
31161 }
31163 {
31166 {
31168 }
31169 }
31170 }
31171 else
31172 {
31174 }
31176 if (this.ai[2] > 5
f)
31177 {
31181 }
31182 }
31183 else if (this.ai[0] == 3
f)
31184 {
31187 if (Main.expertMode)
31188 {
31191 }
31204 if (Main.expertMode)
31205 {
31207 }
31210 {
31212 if (Main.netMode != 1)
31213 {
31215 if (Main.expertMode)
31216 {
31218 }
31219 if (Main.expertMode && (
double)
life < (double)
lifeMax * 0.1)
31220 {
31222 }
31227 {
31229 }
31231 {
31233 }
31243 Main.projectile[
num1260].timeLeft = 300;
31244 }
31245 }
31247 {
31251 {
31253 }
31260 {
31263 {
31265 }
31266 }
31268 {
31271 {
31273 }
31274 }
31276 {
31279 {
31281 }
31282 }
31284 {
31287 {
31289 }
31290 }
31291 }
31293 {
31298 {
31301 {
31303 }
31304 }
31306 {
31309 {
31311 }
31312 }
31314 {
31317 {
31319 }
31320 }
31322 {
31325 {
31327 }
31328 }
31329 }
31333 {
31337 }
31338 }
31339 else if (this.ai[0] == 4
f)
31340 {
31349 {
31351 }
31352 else
31353 {
31355 }
31358 {
31361 }
31362 }
31363 }
31365 {
31368 {
31370 {
31372 }
31373 else
31374 {
31376 }
31378 }
31380 {
31382 {
31384 }
31385 else
31386 {
31388 }
31390 }
31392 {
31395 {
31399 {
31407 dust87.velocity *= 0.5f;
31408 dust70.scale = 1
f + Main.rand.NextFloat() * 0.5f;
31409 dust70.fadeIn = 1.5f + Main.rand.NextFloat() * 0.5f;
31412 dust87.velocity +=
velocity * 0.5f;
31413 }
31414 }
31417 {
31419 }
31421 {
31423 {
31431 dust87.velocity *= 1
f;
31432 dust80.scale = 1
f + Main.rand.NextFloat() * 0.5f;
31433 dust80.fadeIn = 1.5f + Main.rand.NextFloat() * 0.5f;
31436 dust87.velocity +=
velocity * 0.3f;
31437 }
31438 }
31439 if (Main.rand.Next(3) == 0)
31440 {
31448 dust87.velocity *= 0
f;
31449 dust81.alpha = 120;
31450 dust81.scale = 0.7f + Main.rand.NextFloat() * 0.5f;
31453 dust87.velocity +=
velocity * 0.3f;
31454 }
31456 }
31459 if (
target == 255 || (
type != 587 && Main.player[
target].wet) || Main.player[
target].dead || Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
31460 {
31463 }
31464 else if (this.ai[0] > 0
f)
31465 {
31468 }
31470 {
31472 }
31482 {
31492 {
31494 {
31496 {
31497 velocity.X -= 0.05f;
31498 }
31499 else
31500 {
31501 velocity.X += 0.05f;
31502 }
31504 {
31505 velocity.Y -= 0.05f;
31506 }
31507 else
31508 {
31509 velocity.Y += 0.05f;
31510 }
31511 }
31512 }
31513 }
31514 else if (
type == 581)
31515 {
31525 {
31527 {
31529 {
31530 velocity.X -= 0.05f;
31531 }
31532 else
31533 {
31534 velocity.X += 0.05f;
31535 }
31537 {
31538 velocity.Y -= 0.05f;
31539 }
31540 else
31541 {
31542 velocity.Y += 0.05f;
31543 }
31544 }
31545 }
31546 }
31547 else if (
type == 587)
31548 {
31556 if (Main.dayTime)
31557 {
31560 }
31561 }
31562 if (this.ai[0] <= 0
f)
31563 {
31568 {
31570 }
31572 {
31574 }
31575 }
31577 {
31579 {
31582 {
31584 }
31586 {
31588 }
31590 {
31592 }
31593 }
31595 {
31598 {
31600 }
31602 {
31604 }
31606 {
31608 }
31609 }
31610 }
31612 {
31614 }
31616 {
31619 {
31621 }
31622 }
31623 else
31624 {
31627 {
31629 }
31630 }
31632 {
31634 }
31636 {
31638 }
31640 {
31642 {
31643 velocity.Y *= 0.95f;
31644 }
31645 velocity.Y -= 0.5f;
31647 {
31649 }
31650 }
31651 }
31653 {
31655 }
31657 {
31659 if (Main.getGoodWorld)
31660 {
31662 }
31663 if ((!Main.player[
target].ZoneLihzhardTemple && !Main.player[
target].ZoneJungle) || (
double)Main.player[
target].Center.Y < Main.worldSurface * 16.0)
31664 {
31666 }
31669 {
31671 return;
31672 }
31682 {
31686 }
31687 else
31688 {
31693 }
31695 {
31698 {
31700 }
31702 }
31703 if (this.ai[0] == 0
f)
31704 {
31707 if (this.ai[1] < 20
f || this.ai[1] > (
float)(
num1287 - 20))
31708 {
31711 }
31712 else
31713 {
31716 }
31717 if (this.ai[1] >= (
float)
num1287)
31718 {
31732 if (Main.netMode != 1)
31733 {
31735 }
31736 }
31737 }
31738 else if (this.ai[0] == 1
f)
31739 {
31744 {
31746 vector309.X -= 40
f *
scale;
31747 }
31748 else if (Main.player[
target].Center.X >
base.Center.X + (
float)
width)
31749 {
31751 vector309.X += 40
f *
scale;
31752 }
31753 else
31754 {
31756 }
31760 {
31762 }
31764 {
31766 }
31768 if (this.ai[1] < 20
f || this.ai[1] > (
float)(
num1297 - 20))
31769 {
31771 }
31772 else
31773 {
31775 }
31776 if (this.ai[1] >= (
float)
num1297)
31777 {
31789 if (Main.netMode != 1)
31790 {
31792 }
31793 }
31796 {
31798 }
31800 {
31802 }
31804 {
31806 }
31807 if (!Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
31808 {
31810 }
31811 if (this.ai[2] > (float)(60 + Main.rand.Next(600)))
31812 {
31817 {
31819 {
31822 {
31823 vector309.X -= 18
f *
scale;
31824 }
31825 else
31826 {
31827 vector309.X += 18
f *
scale;
31828 }
31838 if (Main.netMode != 1)
31839 {
31841 Main.projectile[
num1313].timeLeft = 300;
31842 }
31843 }
31844 }
31846 {
31849 {
31850 vector309.X -= 30
f *
scale;
31851 }
31853 {
31854 vector309.X += 30
f *
scale;
31855 }
31865 if (Main.netMode != 1)
31866 {
31868 Main.projectile[
num1319].timeLeft = 300;
31869 }
31870 }
31871 }
31872 }
31874 {
31876 }
31877 else
31878 {
31880 }
31881 }
31883 {
31885 }
31887 {
31890 if (Main.getGoodWorld)
31891 {
31893 }
31894 if ((!Main.player[
target].ZoneLihzhardTemple && !Main.player[
target].ZoneJungle) || (
double)Main.player[
target].Center.Y < Main.worldSurface * 16.0)
31895 {
31897 }
31898 if (!Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
31899 {
31902 }
31904 {
31906 }
31908 {
31910 return;
31911 }
31918 float num1324 = Main.player[
target].Center.Y - vector310.Y - 300
f;
31924 {
31927 {
31929 }
31930 }
31932 {
31935 {
31937 }
31938 }
31940 {
31943 {
31945 }
31946 }
31948 {
31951 {
31953 }
31954 }
31958 {
31960 }
31962 {
31964 }
31966 {
31968 }
31970 {
31972 }
31974 if (this.ai[1] < 20
f || this.ai[1] > (
float)(
num1327 - 20))
31975 {
31977 }
31978 else
31979 {
31981 }
31983 {
31985 }
31986 if (this.ai[1] >= (
float)
num1327)
31987 {
32001 if (Main.netMode != 1)
32002 {
32004 }
32005 }
32009 {
32011 }
32013 {
32015 }
32017 {
32019 }
32021 {
32023 }
32025 {
32027 }
32029 {
32031 }
32033 {
32035 }
32037 if (!Collision.CanHit(Main.npc[
golemBoss].Center, 1, 1, Main.player[
target].Center, 1, 1))
32038 {
32040 }
32042 {
32044 }
32045 if (this.ai[2] > (float)(100 + Main.rand.Next(4800)))
32046 {
32050 {
32053 {
32054 case 0:
32055 vector312.X -= 14
f *
scale;
32056 break;
32057 case 1:
32058 vector312.X += 14
f *
scale;
32059 break;
32060 }
32065 {
32068 }
32070 {
32073 }
32075 {
32078 }
32080 {
32083 }
32085 {
32088 }
32089 float num1342 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f;
32090 float num1343 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f;
32092 {
32095 num1342 += Main.player[
target].velocity.X * Main.rand.NextFloat() * 50
f;
32096 num1343 += Main.player[
target].velocity.Y * Main.rand.NextFloat() * 50
f;
32097 }
32106 if (Main.netMode != 1)
32107 {
32109 Main.projectile[
num1345].timeLeft = 300;
32110 }
32111 }
32112 }
32113 if (!Main.getGoodWorld)
32114 {
32116 int num1346 = Main.rand.Next(2) * 2 - 1;
32118 Vector2?
val60 = ((float)
Math.PI / 2
f + -(
float)Math.PI / 2
f * (float)
num1346 + Main.rand.NextFloatDirection() * ((float)
Math.PI / 4
f)).ToRotationVector2() * (2
f + Main.rand.NextFloat());
32124 dust82.noGravity = true;
32125 Vector2
val61 = base.Bottom +
new Vector2(Main.rand.NextFloatDirection() * 6
f *
scale, (Main.rand.NextFloat() * -4
f - 8
f) *
scale);
32126 Vector2?
val62 = Vector2.UnitY * (2
f + Main.rand.NextFloat());
32129 dust82.fadeIn = 0
f;
32130 dust82.scale = 0.7f + Main.rand.NextFloat() * 0.5f;
32131 dust82.noGravity = true;
32136 }
32137 }
32139 {
32147 float num1350 = Main.player[
target].Center.Y - vector314.Y - 200
f;
32150 {
32153 }
32154 else
32155 {
32159 }
32161 {
32164 {
32166 }
32167 }
32169 {
32172 {
32174 }
32175 }
32177 {
32180 {
32182 }
32183 }
32185 {
32188 {
32190 }
32191 }
32193 {
32195 if (this.ai[0] > 8
f)
32196 {
32201 }
32202 }
32203 }
32205 {
32208 {
32211 {
32215 return;
32216 }
32217 }
32218 else
32219 {
32221 }
32222 velocity.Y += 0.02f;
32225 {
32226 velocity.Y *= 0.95f;
32227 }
32229 {
32231 }
32233 {
32235 {
32236 velocity.X *= 0.98f;
32237 }
32238 if (Main.expertMode &&
velocity.X < 0
f)
32239 {
32240 velocity.X *= 0.98f;
32241 }
32242 velocity.X += 0.1f;
32243 if (Main.expertMode)
32244 {
32245 velocity.X += 0.1f;
32246 }
32247 }
32249 {
32251 {
32252 velocity.X *= 0.98f;
32253 }
32254 if (Main.expertMode &&
velocity.X > 0
f)
32255 {
32256 velocity.X *= 0.98f;
32257 }
32258 velocity.X -= 0.1f;
32259 if (Main.expertMode)
32260 {
32261 velocity.X -= 0.1f;
32262 }
32263 }
32265 {
32266 velocity.X *= 0.97f;
32267 }
32269 }
32271 {
32275 if (Main.player[
target].dead)
32276 {
32279 }
32280 else if (Main.netMode != 1 &&
target >= 0 &&
target < 255)
32281 {
32284 {
32286 }
32287 }
32289 if (
localAI[0] == 0
f && Main.netMode != 1)
32290 {
32295 }
32296 int[]
array2 =
new int[3];
32301 {
32302 if (Main.npc[
num1360].active && Main.npc[
num1360].aiStyle == 52)
32303 {
32309 {
32310 break;
32311 }
32312 }
32313 }
32319 {
32322 }
32324 {
32326 }
32327 if (!Main.player[
target].ZoneJungle || (
double)Main.player[
target].position.Y < Main.worldSurface * 16.0 || Main.player[
target].position.Y > (float)(Main.UnderworldLayer * 16))
32328 {
32332 }
32333 if (Main.expertMode)
32334 {
32339 }
32340 if (Main.getGoodWorld)
32341 {
32344 }
32350 {
32354 }
32358 {
32360 }
32361 if (Main.expertMode)
32362 {
32364 }
32366 {
32370 }
32378 {
32381 }
32382 else
32383 {
32387 }
32389 {
32392 {
32394 }
32395 }
32397 {
32400 {
32402 }
32403 }
32405 {
32408 {
32410 }
32411 }
32413 {
32416 {
32418 }
32419 }
32426 {
32430 {
32433 }
32435 if (Main.netMode == 1)
32436 {
32437 return;
32438 }
32441 {
32443 }
32445 {
32447 }
32449 {
32451 }
32453 {
32455 }
32457 {
32459 }
32460 if (Main.expertMode)
32461 {
32463 }
32464 if (Main.expertMode &&
justHit && Main.rand.Next(2) == 0)
32465 {
32467 }
32468 if (Main.getGoodWorld)
32469 {
32471 }
32473 {
32474 return;
32475 }
32479 {
32482 }
32484 {
32488 if (Main.expertMode)
32489 {
32491 }
32502 if (Main.expertMode)
32503 {
32506 }
32508 {
32512 }
32514 {
32518 }
32520 {
32522 }
32528 {
32529 Main.projectile[
num1378].timeLeft = 300;
32530 }
32531 }
32532 return;
32533 }
32537 {
32540 }
32542 if (Main.netMode != 1)
32543 {
32545 {
32548 if (Main.getGoodWorld)
32549 {
32551 }
32553 {
32555 }
32556 if (Main.expertMode)
32557 {
32559 {
32560 if (Main.npc[
num1383].active && Main.npc[
num1383].aiStyle == 52)
32561 {
32563 {
32566 }
32567 }
32568 }
32569 }
32570 }
32571 else if (Main.expertMode && Main.rand.Next(60) == 0)
32572 {
32575 {
32577 {
32579 }
32580 }
32582 {
32584 }
32585 }
32586 }
32588 {
32593 }
32594 if (Main.netMode == 1)
32595 {
32596 return;
32597 }
32600 {
32602 }
32604 {
32606 }
32608 {
32610 }
32612 {
32614 }
32616 {
32618 Vector2
vector3 =
default(Vector2);
32620 float num1392 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
vector3.X + (
float)Main.rand.Next(-10, 11);
32622 float num1394 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f -
vector3.Y + (
float)Main.rand.Next(-10, 11);
32624 {
32626 }
32635 Main.npc[
num1397].netUpdate =
true;
32637 }
32638 }
32640 {
32644 {
32647 return;
32648 }
32649 if (Main.player[Main.npc[
plantBoss].target].dead)
32650 {
32652 }
32653 if ((
plantBoss != -1 && !Main.player[Main.npc[
plantBoss].target].ZoneJungle) || (
double)Main.player[Main.npc[
plantBoss].target].position.Y < Main.worldSurface * 16.0 || Main.player[Main.npc[
plantBoss].target].position.Y > (
float)(Main.UnderworldLayer * 16) ||
flag50)
32654 {
32657 }
32658 if (Main.netMode == 1)
32659 {
32660 if (this.ai[0] == 0
f)
32661 {
32662 this.ai[0] = (int)(
base.Center.X / 16
f);
32663 }
32664 if (this.ai[1] == 0
f)
32665 {
32666 this.ai[1] = (int)(
base.Center.X / 16
f);
32667 }
32668 }
32669 if (Main.netMode != 1)
32670 {
32671 if (this.ai[0] == 0
f || this.ai[1] == 0
f)
32672 {
32674 }
32677 {
32679 }
32681 {
32683 }
32685 {
32687 }
32689 {
32691 {
32693 {
32694 localAI[0] = Main.rand.Next(60, 300);
32695 }
32696 }
32697 }
32699 {
32700 localAI[0] = Main.rand.Next(300, 600);
32704 {
32708 if (this.ai[0] == 0
f)
32709 {
32712 }
32714 {
32717 }
32722 if (Main.npc[
plantBoss].life < Main.npc[
plantBoss].lifeMax / 2 && Main.rand.Next(6) == 0)
32723 {
32728 {
32731 }
32732 }
32733 try
32734 {
32736 {
32741 }
32742 }
32743 catch
32744 {
32745 }
32746 }
32747 }
32748 }
32749 if (!(this.ai[0] > 0
f) || !(this.ai[1] > 0
f))
32750 {
32751 return;
32752 }
32755 {
32757 }
32759 {
32761 }
32762 if (Main.expertMode)
32763 {
32765 }
32767 {
32769 }
32771 {
32773 }
32775 {
32777 }
32778 Vector2
vector4 =
default(Vector2);
32784 {
32785 if (Main.netMode != 1 && Main.getGoodWorld &&
localAI[3] == 1
f)
32786 {
32789 }
32792 }
32793 else
32794 {
32795 if (Main.netMode != 1 && Main.getGoodWorld)
32796 {
32798 }
32802 }
32803 Vector2
vector5 =
default(Vector2);
32808 }
32810 {
32811 if (Main.getGoodWorld)
32812 {
32813 if (Main.rand.Next(10) == 0)
32814 {
32816 }
32817 else
32818 {
32820 }
32821 }
32823 {
32826 return;
32827 }
32829 if (this.ai[3] > 0
f)
32830 {
32831 num1414 = (int)this.ai[3] - 1;
32832 }
32833 if (Main.netMode != 1)
32834 {
32837 {
32838 localAI[0] = Main.rand.Next(120, 480);
32839 this.ai[0] = Main.rand.Next(-100, 101);
32840 this.ai[1] = Main.rand.Next(-100, 101);
32842 }
32843 }
32848 {
32850 }
32852 {
32854 }
32855 if (Main.expertMode)
32856 {
32860 }
32861 if (Main.getGoodWorld)
32862 {
32864 }
32866 {
32868 return;
32869 }
32872 Vector2
vector6 =
default(Vector2);
32883 {
32886 {
32887 velocity.X *= 0.9f;
32888 }
32889 }
32891 {
32894 {
32895 velocity.X *= 0.9f;
32896 }
32897 }
32899 {
32902 {
32903 velocity.Y *= 0.9f;
32904 }
32905 }
32907 {
32910 {
32911 velocity.Y *= 0.9f;
32912 }
32913 }
32915 {
32917 }
32919 {
32921 }
32923 {
32925 }
32927 {
32929 }
32931 {
32934 }
32936 {
32939 }
32940 }
32942 {
32944 if (Main.netMode != 1 &&
localAI[0] == 0
f)
32945 {
32949 {
32950 float x2 =
base.Center.X;
32951 float y4 =
base.Center.Y;
32955 Main.npc[
num1427].velocity =
new Vector2((
float)Main.rand.Next(-30, 31) * 0.1f, (
float)Main.rand.Next(-30, 31) * 0.1f);
32956 Main.npc[
num1427].netUpdate =
true;
32957 }
32958 }
32959 if (Main.netMode != 1)
32960 {
32964 {
32967 if (Main.netMode == 2)
32968 {
32969 NetMessage.SendData(23, -1, -1,
null,
whoAmI);
32970 }
32971 }
32972 }
32973 if (this.ai[0] < 0
f)
32974 {
32975 if (Main.getGoodWorld)
32976 {
32978 }
32980 {
32983 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f), 392);
32984 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f), 393);
32985 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f), 394);
32986 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f), 395);
32988 {
32992 float speedX24 = (float)Main.rand.Next(-30, 31) * 0.2f;
32993 float speedY23 = (float)Main.rand.Next(-30, 31) * 0.2f;
32996 }
32998 }
33001 Vector2
vector7 =
default(Vector2);
33010 velocity.X = (velocity.X * 50
f +
num1431) / 51
f;
33011 velocity.Y = (velocity.Y * 50
f +
num1432) / 51
f;
33012 if (this.ai[0] == -1
f)
33013 {
33014 if (Main.netMode != 1)
33015 {
33018 {
33019 localAI[1] -= Main.rand.Next(5);
33020 }
33021 int num1435 = 60 + Main.rand.Next(120);
33022 if (Main.netMode != 0)
33023 {
33024 num1435 += Main.rand.Next(30, 90);
33025 }
33027 {
33032 Vector2 v = default(Vector2);
33033 do
33034 {
33043 if (Main.rand.Next(2) == 0)
33044 {
33046 }
33047 if (Main.rand.Next(2) == 0)
33048 {
33050 }
33052 if (Vector2.Dot(
player4.velocity.SafeNormalize(Vector2.UnitY), v.SafeNormalize(Vector2.UnitY)) > 0
f)
33053 {
33054 v += v.SafeNormalize(Vector2.Zero) *
num1441 * ((Vector2)(
ref player4.velocity)).Length();
33055 }
33059 {
33066 break;
33067 }
33068 }
33070 }
33071 }
33072 }
33073 else if (this.ai[0] == -2
f)
33074 {
33076 if (Main.netMode != 0)
33077 {
33079 }
33080 else
33081 {
33083 }
33084 if (this.ai[3] >= 255
f)
33085 {
33087 position.X = this.ai[1] * 16
f - (float)(
width / 2);
33088 position.Y = this.ai[2] * 16
f - (float)(
height / 2);
33093 }
33094 alpha = (int)this.ai[3];
33095 }
33096 else if (this.ai[0] == -3
f)
33097 {
33098 if (Main.netMode != 0)
33099 {
33101 }
33102 else
33103 {
33105 }
33106 if (this.ai[3] <= 0
f)
33107 {
33112 }
33113 alpha = (int)this.ai[3];
33114 }
33115 }
33116 else
33117 {
33119 Vector2
vector8 =
default(Vector2);
33125 if (Main.getGoodWorld)
33126 {
33128 }
33130 {
33133 }
33134 else
33135 {
33139 }
33140 if (this.ai[0] == 0
f)
33141 {
33142 if (Main.netMode != 1)
33143 {
33146 {
33148 {
33150 }
33151 }
33153 {
33158 }
33160 if (
localAI[1] >= (
float)(120 + Main.rand.Next(300)))
33161 {
33166 Vector2
v5 =
default(Vector2);
33167 do
33168 {
33177 if (Main.rand.Next(2) == 0)
33178 {
33180 }
33181 if (Main.rand.Next(2) == 0)
33182 {
33184 }
33186 if (Vector2.Dot(
player5.velocity.SafeNormalize(Vector2.UnitY),
v5.SafeNormalize(Vector2.UnitY)) > 0
f)
33187 {
33189 }
33193 {
33198 break;
33199 }
33200 }
33202 }
33203 }
33204 }
33205 else if (this.ai[0] == 1
f)
33206 {
33209 {
33212 position.X = this.ai[1] * 16
f - (float)(
width / 2);
33213 position.Y = this.ai[2] * 16
f - (float)(
height / 2);
33215 }
33216 }
33217 else if (this.ai[0] == 2
f)
33218 {
33221 {
33224 }
33225 }
33226 }
33227 if (Main.player[
target].dead || !Main.player[
target].ZoneCrimson)
33228 {
33230 {
33232 }
33234 {
33235 velocity.Y += (
localAI[3] - 60
f) * 0.25
f;
33236 }
33239 }
33241 {
33243 }
33244 }
33246 {
33248 {
33251 return;
33252 }
33253 if (this.ai[0] == 0
f)
33254 {
33256 Vector2
vector9 =
default(Vector2);
33262 {
33266 velocity.X = (velocity.X * 15
f +
num1458) / 16
f;
33267 velocity.Y = (velocity.Y * 15
f +
num1459) / 16
f;
33268 return;
33269 }
33271 {
33272 velocity.Y *= 1.05f;
33273 velocity.X *= 1.05f;
33274 }
33275 if (Main.netMode != 1 && ((Main.expertMode && Main.rand.Next(100) == 0) || Main.rand.Next(200) == 0))
33276 {
33287 }
33288 return;
33289 }
33290 if (Main.expertMode)
33291 {
33294 if (Main.getGoodWorld)
33295 {
33298 }
33299 else
33300 {
33303 }
33304 }
33305 Vector2
vector11 =
default(Vector2);
33311 {
33313 }
33314 else
33315 {
33317 {
33318 return;
33319 }
33321 {
33323 if (this.ai[1] > 5
f)
33324 {
33326 }
33327 }
33328 else
33329 {
33331 }
33332 }
33333 }
33335 {
33337 Vector2
vector12 =
default(Vector2);
33346 velocity.X = (velocity.X * 100
f +
num1465) / 101
f;
33347 velocity.Y = (velocity.Y * 100
f +
num1466) / 101
f;
33357 dust87.velocity *= 0.1f;
33358 Main.dust[
num1469].scale = 1.3f;
33359 Main.dust[
num1469].noGravity =
true;
33361 }
33363 {
33367 if (!Main.dayTime)
33368 {
33370 }
33373 {
33375 }
33377 {
33379 }
33381 {
33382 Lighting.AddLight(
base.Bottom +
new Vector2(0
f, -30
f), 0.3
f, 0.16
f, 0.125
f);
33383 }
33385 {
33386 Lighting.AddLight(
base.Bottom +
new Vector2(0
f, -30
f), 0.3
f, 0.125
f, 0.06
f);
33387 }
33388 if (Main.dayTime)
33389 {
33392 }
33393 else if (this.ai[0] == 0
f)
33394 {
33397 {
33399 }
33401 {
33403 }
33404 if (this.ai[1] >= 300
f && Main.netMode != 1)
33405 {
33408 {
33409 this.ai[0] = Main.rand.Next(3, 5);
33410 }
33411 else
33412 {
33413 this.ai[0] = Main.rand.Next(1, 3);
33414 }
33416 }
33417 }
33418 else if (this.ai[0] == 1
f)
33419 {
33421 {
33422 if (Main.rand.Next(5) == 0)
33423 {
33424 int num1471 = Dust.NewDust(
position + Main.rand.NextVector2Square(0
f, 1
f) *
base.Size -
new Vector2(1
f, 2
f), 10, 14, 245, 0
f, 0
f, 254, Color.Transparent, 0.25f);
33427 dust87.velocity *= 0.2f;
33428 }
33431 if (this.ai[1] % 5
f == 0
f)
33432 {
33433 Vector2
vector14 =
default(Vector2);
33437 num1472 += (float)Main.rand.Next(-50, 51);
33438 num1474 += (float)Main.rand.Next(-50, 51);
33445 num1472 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.02f;
33446 num1474 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.02f;
33447 int num1477 = Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector14.X,
vector14.Y,
num1472,
num1474, 345, 43, 0
f, Main.myPlayer, Main.rand.Next(0, 31));
33448 }
33449 if (this.ai[1] >= 180
f)
33450 {
33453 }
33454 }
33455 else
33456 {
33459 if (this.ai[1] % 15
f == 0
f)
33460 {
33461 Vector2
vector15 =
default(Vector2);
33470 num1478 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.01f;
33471 num1479 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.01f;
33473 }
33474 if (this.ai[1] >= 120
f)
33475 {
33478 }
33479 }
33480 }
33481 else if (this.ai[0] == 2
f)
33482 {
33484 {
33487 if (this.ai[1] > 60
f && this.ai[1] < 240
f && this.ai[1] % 15
f == 0
f)
33488 {
33490 Vector2
vector16 =
default(Vector2);
33496 num1485 += (float)Main.rand.Next(-50, 51);
33497 num1486 -= (float)Main.rand.Next(50, 201);
33502 num1485 *= 1
f + (float)Main.rand.Next(-30, 31) * 0.01f;
33503 num1486 *= 1
f + (float)Main.rand.Next(-30, 31) * 0.01f;
33504 int num1488 = Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector16.X,
vector16.Y,
num1485,
num1486, 346, 57, 0
f, Main.myPlayer, 0
f, Main.rand.Next(2));
33505 }
33506 if (this.ai[1] >= 300
f)
33507 {
33510 }
33511 }
33512 else
33513 {
33516 if (this.ai[1] > 60
f && this.ai[1] < 240
f && this.ai[1] % 8
f == 0
f)
33517 {
33519 Vector2
vector17 =
default(Vector2);
33526 {
33528 }
33529 num1490 += (float)Main.rand.Next(-50, 51);
33530 num1491 -= (float)Main.rand.Next(50, 201);
33535 num1490 *= 1
f + (float)Main.rand.Next(-30, 31) * 0.01f;
33536 num1491 *= 1
f + (float)Main.rand.Next(-30, 31) * 0.01f;
33538 }
33539 if (this.ai[1] >= 300
f)
33540 {
33543 }
33544 }
33545 }
33546 else if (this.ai[0] == 3
f)
33547 {
33550 if (this.ai[1] % 30
f == 0
f)
33551 {
33552 Vector2
vector18 =
default(Vector2);
33561 num1494 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.001f;
33562 num1497 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.001f;
33564 }
33565 if (this.ai[1] >= 120
f)
33566 {
33569 }
33570 }
33571 else if (this.ai[0] == 4
f)
33572 {
33575 if (this.ai[1] % 10
f == 0
f)
33576 {
33578 Vector2
vector19 =
default(Vector2);
33585 {
33587 }
33588 num1502 += (float)Main.rand.Next(-50, 51);
33589 num1503 -= (float)Main.rand.Next(50, 201);
33594 num1502 *= 1
f + (float)Main.rand.Next(-30, 31) * 0.005f;
33595 num1503 *= 1
f + (float)Main.rand.Next(-30, 31) * 0.005f;
33597 }
33598 if (this.ai[1] >= 240
f)
33599 {
33602 }
33603 }
33605 {
33607 }
33609 {
33610 velocity.X *= 0.9f;
33611 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
33612 {
33614 }
33615 }
33616 else
33617 {
33619 {
33620 velocity.X = (velocity.X * 20
f +
num1470) / 21
f;
33621 }
33623 {
33624 velocity.X = (velocity.X * 20
f -
num1470) / 21
f;
33625 }
33626 }
33629 Vector2
vector20 =
default(Vector2);
33633 {
33635 }
33637 {
33638 velocity.Y += 0.5f;
33639 }
33641 {
33643 {
33645 }
33646 if ((double)velocity.Y > -0.2)
33647 {
33648 velocity.Y -= 0.025f;
33649 }
33650 else
33651 {
33652 velocity.Y -= 0.2f;
33653 }
33655 {
33657 }
33658 }
33659 else
33660 {
33662 {
33664 }
33665 if ((double)velocity.Y < 0.1)
33666 {
33667 velocity.Y += 0.025f;
33668 }
33669 else
33670 {
33671 velocity.Y += 0.5f;
33672 }
33673 }
33675 {
33677 }
33678 }
33680 {
33683 {
33687 {
33689 }
33690 }
33692 {
33693 Lighting.AddLight(
base.Center, 0.4f, 0.4f, 0.2f);
33694 }
33695 if (Main.netMode != 1)
33696 {
33699 {
33700 this.ai[3] = Main.rand.Next(3);
33702 }
33704 {
33706 Vector2
vector21 =
default(Vector2);
33709 {
33712 num1510 += (float)Main.rand.Next(-50, 51);
33713 num1511 += (float)Main.rand.Next(50, 201);
33719 num1510 *= 1
f + (float)Main.rand.Next(-30, 31) * 0.01f;
33720 num1511 *= 1
f + (float)Main.rand.Next(-30, 31) * 0.01f;
33722 }
33723 }
33724 }
33725 if (this.ai[0] == 0
f && Main.netMode != 1)
33726 {
33733 Main.npc[
num1514].netUpdate =
true;
33739 Main.npc[
num1514].netUpdate =
true;
33740 }
33742 {
33745 {
33747 }
33748 }
33749 if (Main.dayTime)
33750 {
33751 velocity.Y += 0.3f;
33752 velocity.X *= 0.9f;
33753 }
33754 else if (this.ai[1] == 0
f)
33755 {
33757 if (this.ai[2] >= 300
f)
33758 {
33759 if (this.ai[3] != 1
f)
33760 {
33763 }
33764 else
33765 {
33770 }
33771 }
33772 Vector2
vector22 =
default(Vector2);
33778 if (this.ai[3] == 1
f)
33779 {
33781 {
33783 }
33785 {
33787 }
33789 {
33791 }
33792 }
33794 {
33798 }
33799 }
33800 else if (this.ai[1] == 1
f)
33801 {
33803 if (this.ai[2] >= 600
f || this.ai[3] != 1
f)
33804 {
33807 }
33808 Vector2
vector23 =
default(Vector2);
33816 }
33817 else if (this.ai[1] == 2
f)
33818 {
33820 velocity.Y += 0.1f;
33822 {
33823 velocity.Y *= 0.95f;
33824 }
33825 velocity.X *= 0.95f;
33827 }
33829 }
33831 {
33833 if (!Main.npc[(
int)this.ai[1]].active || Main.npc[(int)this.ai[1]].
aiStyle != 58)
33834 {
33836 if (this.ai[2] > 50
f || Main.netMode != 2)
33837 {
33841 }
33842 }
33843 if (Main.netMode != 1 && Main.npc[(
int)
this.ai[1]].ai[3] == 2
f)
33844 {
33847 {
33850 Vector2
vector25 =
default(Vector2);
33858 int num1527 = Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
num1524,
num1525, 329, 60, 0
f, Main.myPlayer,
rotation,
spriteDirection);
33859 }
33860 }
33861 if (Main.dayTime)
33862 {
33863 velocity.Y += 0.3f;
33864 velocity.X *= 0.9f;
33865 }
33866 else if (this.ai[2] == 0
f || this.ai[2] == 3
f)
33867 {
33868 if (Main.npc[(
int)this.ai[1]].ai[1] == 3
f)
33869 {
33871 }
33873 if (this.ai[3] >= 180
f)
33874 {
33878 }
33879 Vector2
vector26 =
default(Vector2);
33885 float num1531 =
Math.Abs(Main.player[
target].Center.X - Main.npc[(
int)this.ai[1]].Center.X) +
Math.Abs(Main.player[
target].Center.Y - Main.npc[(
int)this.ai[1]].Center.Y);
33887 {
33890 }
33894 {
33896 }
33898 {
33900 }
33902 {
33904 }
33906 {
33908 }
33910 {
33912 }
33913 if (this.ai[0] < 0
f &&
base.Center.X > Main.npc[(
int)this.ai[1]].Center.X)
33914 {
33916 }
33917 if (this.ai[0] > 0
f &&
base.Center.X < Main.npc[(
int)this.ai[1]].Center.X)
33918 {
33920 }
33926 {
33928 }
33929 }
33930 else if (this.ai[2] == 1
f)
33931 {
33932 Vector2
vector27 =
default(Vector2);
33938 velocity.X *= 0.95f;
33939 velocity.Y -= 0.3f;
33941 {
33943 }
33944 if (
position.Y < Main.npc[(
int)this.ai[1]].position.Y - 200
f)
33945 {
33956 }
33957 }
33958 else if (this.ai[2] == 2
f)
33959 {
33960 float num1537 =
Math.Abs(
base.Center.X - Main.npc[(
int)this.ai[1]].Center.X) +
Math.Abs(
base.Center.Y - Main.npc[(
int)this.ai[1]].Center.Y);
33962 {
33964 }
33965 }
33966 else if (this.ai[2] == 4
f)
33967 {
33968 Vector2
vector28 =
default(Vector2);
33974 velocity.Y *= 0.95f;
33975 velocity.X += 0.3f * (0
f - this.ai[0]);
33977 {
33979 }
33981 {
33983 }
33984 if (
position.X + (
float)(
width / 2) < Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2) - 500
f ||
position.X + (
float)(
width / 2) > Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2) + 500
f)
33985 {
33996 }
33997 }
33998 else if (this.ai[2] == 5
f)
33999 {
34000 float num1542 =
Math.Abs(
base.Center.X - Main.npc[(
int)this.ai[1]].Center.X) +
Math.Abs(
base.Center.Y - Main.npc[(
int)this.ai[1]].Center.Y);
34002 {
34004 }
34005 }
34006 }
34008 {
34009 if (Main.dayTime)
34010 {
34012 {
34013 velocity.X += 0.25f;
34014 }
34015 else
34016 {
34017 velocity.X -= 0.25f;
34018 }
34019 velocity.Y -= 0.1f;
34021 }
34022 else if (this.ai[0] == 0
f)
34023 {
34024 if (this.ai[2] == 0
f)
34025 {
34027 if (
base.Center.X < Main.player[
target].Center.X)
34028 {
34030 }
34031 else
34032 {
34034 }
34035 }
34040 {
34042 }
34044 {
34046 }
34050 {
34053 }
34055 {
34058 }
34060 {
34063 }
34064 velocity.X += this.ai[2] *
num1545;
34066 {
34068 }
34070 {
34072 }
34075 {
34076 velocity.Y -= 0.2f;
34077 }
34079 {
34080 velocity.Y += 0.2f;
34081 }
34083 {
34085 }
34087 {
34089 }
34091 if ((
num1544 < 500
f || this.ai[3] < 0
f) && position.Y < Main.player[
target].position.Y)
34092 {
34096 {
34098 }
34100 {
34102 }
34104 {
34106 }
34108 if (this.ai[3] > (
float)
num1548)
34109 {
34111 }
34112 if (this.ai[3] == 0
f && Main.netMode != 1)
34113 {
34114 Vector2
vector29 =
default(Vector2);
34116 vector29.X += velocity.X * 7
f;
34122 {
34124 }
34126 {
34128 }
34130 {
34132 }
34137 }
34138 }
34139 else if (this.ai[3] < 0
f)
34140 {
34142 }
34143 if (Main.netMode != 1)
34144 {
34145 this.ai[1] += Main.rand.Next(1, 4);
34146 if (this.ai[1] > 800
f &&
num1544 < 600
f)
34147 {
34149 }
34150 }
34151 }
34152 else if (this.ai[0] == 1
f)
34153 {
34158 {
34161 }
34163 {
34166 }
34168 {
34171 }
34174 if (
base.Center.X < Main.player[
target].Center.X)
34175 {
34178 {
34179 velocity.X *= 0.98f;
34180 }
34181 }
34182 if (
base.Center.X > Main.player[
target].Center.X)
34183 {
34186 {
34187 velocity.X *= 0.98f;
34188 }
34189 }
34191 {
34192 velocity.X *= 0.95f;
34193 }
34196 {
34197 velocity.Y -= 0.1f;
34198 }
34200 {
34201 velocity.Y += 0.1f;
34202 }
34204 {
34206 }
34208 {
34210 }
34212 if (Main.netMode != 1)
34213 {
34217 {
34219 }
34221 {
34223 }
34225 {
34227 }
34229 {
34231 }
34233 if (this.ai[3] >= (
float)
num1558)
34234 {
34236 Vector2
vector30 =
default(Vector2);
34241 {
34244 {
34246 }
34248 float speedX2 = velocity.X * 0.25f;
34250 }
34251 }
34252 }
34253 if (Main.netMode != 1)
34254 {
34255 this.ai[1] += Main.rand.Next(1, 4);
34256 if (this.ai[1] > 600
f)
34257 {
34259 }
34260 }
34261 }
34262 else if (this.ai[0] == 2
f)
34263 {
34265 Vector2
vector31 =
default(Vector2);
34267 float num1561 = Main.rand.Next(-1000, 1001);
34268 float num1563 = Main.rand.Next(-1000, 1001);
34281 {
34283 }
34285 {
34287 }
34289 {
34291 }
34293 {
34295 }
34296 if (this.ai[3] > (
float)
num1566)
34297 {
34300 }
34301 if (Main.netMode != 1)
34302 {
34303 this.ai[1] += Main.rand.Next(1, 4);
34304 if (this.ai[1] > 500
f)
34305 {
34307 }
34308 }
34309 }
34310 if (this.ai[0] == -1
f)
34311 {
34312 int num1568 = Main.rand.Next(3);
34315 {
34317 }
34322 }
34323 }
34325 {
34329 if (!Main.dayTime)
34330 {
34332 }
34335 {
34337 }
34339 {
34341 }
34343 {
34345 }
34349 {
34351 }
34352 if (Main.dayTime)
34353 {
34357 {
34358 velocity.X = 0.1f;
34359 }
34360 }
34361 else if (this.ai[0] == 0
f)
34362 {
34364 if (this.ai[1] >= 300
f && Main.netMode != 1)
34365 {
34370 }
34371 }
34372 else if (this.ai[0] == 1
f)
34373 {
34378 {
34380 }
34382 {
34384 }
34386 {
34388 }
34389 if (this.ai[1] % (
float)
num1570 == 0
f)
34390 {
34391 Vector2
vector32 =
default(Vector2);
34395 num1571 += (float)Main.rand.Next(-40, 41);
34396 num1572 += (float)Main.rand.Next(-40, 41);
34402 num1571 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.015f;
34403 num1572 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.015f;
34405 }
34406 if (this.ai[1] > 240
f)
34407 {
34410 }
34411 }
34412 if (Main.netMode != 1)
34413 {
34418 {
34422 }
34424 {
34428 }
34430 {
34434 }
34435 if (Main.rand.Next(
num1577) == 0)
34436 {
34437 Vector2
vector33 =
default(Vector2);
34447 }
34448 if (Main.rand.Next(
num1578) == 0)
34449 {
34451 }
34453 {
34457 {
34458 Vector2
vector34 =
default(Vector2);
34462 num1587 += (float)Main.rand.Next(-50, 51);
34463 num1588 += (float)Main.rand.Next(-50, 51);
34469 num1587 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.015f;
34470 num1588 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.015f;
34472 }
34474 {
34476 }
34477 }
34478 if (Main.rand.Next(
num1579) == 0)
34479 {
34481 }
34483 {
34487 {
34488 Vector2
vector36 =
default(Vector2);
34490 float num1593 = Main.rand.Next(-100, 101);
34497 num1593 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.01f;
34498 num1594 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.01f;
34500 }
34502 {
34504 }
34505 }
34506 }
34508 {
34510 }
34512 {
34513 velocity.X *= 0.9f;
34514 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
34515 {
34517 }
34518 }
34519 else
34520 {
34522 {
34523 velocity.X = (velocity.X * 20
f +
num1569) / 21
f;
34524 }
34526 {
34527 velocity.X = (velocity.X * 20
f -
num1569) / 21
f;
34528 }
34529 }
34532 Vector2
vector37 =
default(Vector2);
34536 {
34538 }
34540 {
34541 velocity.Y += 0.5f;
34542 }
34544 {
34546 {
34548 }
34549 if ((double)velocity.Y > -0.2)
34550 {
34551 velocity.Y -= 0.025f;
34552 }
34553 else
34554 {
34555 velocity.Y -= 0.2f;
34556 }
34558 {
34560 }
34561 }
34562 else
34563 {
34565 {
34567 }
34568 if ((double)velocity.Y < 0.1)
34569 {
34570 velocity.Y += 0.025f;
34571 }
34572 else
34573 {
34574 velocity.Y += 0.5f;
34575 }
34576 }
34578 {
34580 }
34581 }
34583 {
34588 Vector2
vector38 =
default(Vector2);
34596 bool flag56 = Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1);
34597 if (Main.dayTime)
34598 {
34600 velocity.X = (velocity.X * (float)(
num4 - 1) -
num1602) / (
float)
num4;
34601 velocity.Y = (velocity.Y * (float)(
num4 - 1) -
num1603) / (
float)
num4;
34603 return;
34604 }
34606 {
34608 velocity.X = (velocity.X * (float)(
num5 - 1) +
num1602) / (
float)
num5;
34609 velocity.Y = (velocity.Y * (float)(
num5 - 1) +
num1603) / (
float)
num5;
34610 return;
34611 }
34614 {
34617 {
34621 num1602 += (float)Main.rand.Next(-35, 36);
34622 num1603 += (float)Main.rand.Next(-35, 36);
34623 num1602 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.015f;
34624 num1603 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.015f;
34630 num1602 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.0125f;
34631 num1603 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.0125f;
34633 }
34634 }
34635 }
34637 {
34640 Vector2
vector39 =
default(Vector2);
34648 if (Main.dayTime)
34649 {
34652 }
34654 if (
num10 < 200
f || this.ai[0] > 0
f)
34655 {
34657 {
34659 }
34661 {
34663 }
34664 else
34665 {
34667 }
34669 return;
34670 }
34671 velocity.X = (velocity.X * 50
f +
num8) / 51
f;
34672 velocity.Y = (velocity.Y * 50
f +
num9) / 51
f;
34674 {
34675 velocity.X = (velocity.X * 10
f +
num8) / 11
f;
34676 velocity.Y = (velocity.Y * 10
f +
num9) / 11
f;
34677 }
34679 {
34680 velocity.X = (velocity.X * 7
f +
num8) / 8
f;
34681 velocity.Y = (velocity.Y * 7
f +
num9) / 8
f;
34682 }
34684 }
34686 {
34687 float num12 = this.ai[0];
34688 float num13 = this.ai[1];
34689 if (Main.netMode != 1)
34690 {
34692 if (this.ai[3] == 0
f)
34693 {
34694 this.ai[3] = (float)Main.rand.Next(75, 111) * 0.01f;
34695 }
34697 {
34699 localAI[0] = Main.rand.Next(60, 180);
34702 {
34703 float num16 = (float)Main.rand.Next(50, 151) * 0.01f;
34705 {
34706 num16 = (float)Main.rand.Next(150, 201) * 0.01f;
34707 }
34709 {
34710 num16 = (float)Main.rand.Next(100, 151) * 0.01f;
34711 }
34713 int num18 = Main.rand.Next(-50, 51);
34715 {
34716 num18 -= Main.rand.Next(100, 251);
34717 }
34721 }
34722 else
34723 {
34725 float num20 = (float)Main.rand.Next(5, 151) * 0.01f;
34726 int num21 = Main.rand.Next(-100, 101);
34727 int num22 = Main.rand.Next(-100, 101);
34731 }
34733 }
34734 }
34735 scale = this.ai[3];
34737 {
34742 {
34745 {
34747 }
34749 }
34751 {
34754 {
34756 }
34758 }
34760 {
34763 {
34765 }
34767 }
34769 {
34772 {
34774 }
34776 }
34778 {
34780 }
34782 {
34785 Vector2
zero = Vector2.Zero;
34787 {
34790 {
34793 }
34794 }
34796 {
34799 {
34802 }
34803 }
34805 {
34811 {
34813 }
34817 }
34818 }
34819 }
34821 {
34822 int i3 = (int)
base.Center.X / 16;
34823 int j3 = (int)
base.Center.Y / 16;
34825 {
34827 {
34829 }
34830 else if (
type == 654)
34831 {
34833 }
34834 else
34835 {
34837 }
34838 }
34840 }
34842 {
34844 }
34845 else
34846 {
34847 localAI[1] = Main.rand.Next(30, 180);
34848 if (!Main.dayTime || (
double)(
position.Y / 16
f) > Main.worldSurface + 10.0)
34849 {
34850 localAI[2] = Main.rand.Next(10, 30);
34851 }
34852 }
34854 velocity.X = (velocity.X * (float)(
num30 - 1) +
num12) / (
float)
num30;
34855 velocity.Y = (velocity.Y * (float)(
num30 - 1) +
num13) / (
float)
num30;
34857 {
34862 {
34864 {
34867 {
34868 velocity.Y *= 0.9f;
34869 }
34870 }
34871 }
34872 }
34874 {
34880 {
34882 {
34884 }
34885 }
34887 {
34890 {
34891 velocity.Y *= 0.9f;
34892 }
34893 }
34894 }
34896 {
34898 velocity.X *= -0.2f;
34899 }
34901 {
34903 }
34905 {
34907 }
34909 {
34911 }
34912 this.ai[0] =
num12;
34913 this.ai[1] =
num13;
34914 }
34916 {
34918 }
34920 {
34922 {
34923 float num40 = (float)Main.rand.Next(90, 111) * 0.01f;
34924 num40 *= (Main.essScale + 0.5f) / 2
f;
34926 }
34928 {
34929 if (this.ai[0] == 1
f)
34930 {
34932 {
34934 }
34936 {
34938 }
34939 float num41 = 0.2f;
34941 {
34943 }
34945 {
34947 }
34949 {
34951 }
34954 {
34956 }
34957 }
34958 else
34959 {
34961 }
34962 if (Main.netMode != 1)
34963 {
34966 {
34967 if (this.ai[0] == 1
f)
34968 {
34970 localAI[1] = Main.rand.Next(300, 900);
34971 }
34972 else
34973 {
34975 localAI[1] = Main.rand.Next(600, 1800);
34976 }
34978 }
34979 }
34980 }
34982 {
34985 {
34987 }
34988 }
34990 {
34991 return;
34992 }
34996 {
34999 {
35001 break;
35002 }
35003 }
35006 {
35007 this.ai[1]++;
35008 }
35009 if (this.ai[1] == (
float)
num43 && Main.netMode != 1)
35010 {
35014 }
35015 }
35017 {
35018 if (Main.netMode != 1)
35019 {
35023 if (tile.shimmer() && tile.liquid > 30)
35024 {
35026 return;
35027 }
35028 }
35030 {
35031 if (this.ai[3] != 0
f)
35032 {
35033 scale = this.ai[3];
35037 {
35038 position.X = position.X + (float)(
width / 2) - (float)
num46 - 2
f;
35040 }
35042 {
35043 position.Y = position.Y + (float)
height - (
float)
num48;
35045 }
35046 }
35047 if (this.ai[3] == 0
f && Main.netMode != 1)
35048 {
35049 this.ai[3] = (float)Main.rand.Next(80, 111) * 0.01f;
35051 }
35052 }
35054 {
35055 Lighting.AddLight((
int)base.Center.X / 16, (int)
base.Center.Y / 16, 0.1f, 0.2f, 0.7f);
35056 }
35058 {
35059 Lighting.AddLight((
int)base.Center.X / 16, (int)
base.Center.Y / 16, 0.6f, 0.3f, 0.1f);
35060 }
35061 float num49 = 0.3f;
35063 {
35065 }
35066 if (this.ai[0] == 0
f)
35067 {
35072 {
35074 }
35075 }
35077 if (Main.netMode != 1)
35078 {
35079 if (this.ai[2] == 0
f && Main.rand.Next(7200) == 0)
35080 {
35083 }
35085 {
35088 {
35091 }
35092 }
35093 else
35094 {
35096 }
35097 }
35098 if (this.ai[2] > 0
f)
35099 {
35104 {
35106 }
35107 else
35108 {
35110 }
35117 {
35119 }
35123 {
35125 }
35127 {
35132 }
35134 {
35136 {
35139 {
35143 }
35144 }
35145 else
35146 {
35149 }
35150 }
35151 }
35152 if (this.ai[2] != 0
f)
35153 {
35154 return;
35155 }
35157 if (this.ai[1] == 0
f)
35158 {
35160 {
35162 }
35164 {
35168 }
35170 {
35173 }
35174 }
35175 else
35176 {
35178 {
35180 }
35182 {
35186 }
35188 {
35191 }
35192 }
35194 {
35197 {
35199 {
35201 {
35204 }
35206 {
35209 }
35210 }
35212 {
35215 }
35217 {
35220 }
35221 }
35223 {
35225 {
35228 }
35230 {
35233 }
35234 }
35236 {
35239 }
35241 {
35244 }
35248 {
35250 }
35252 {
35254 }
35256 float num55 = 0.1f;
35258 {
35259 if ((
double)
num54 > 3.14)
35260 {
35262 }
35263 else
35264 {
35267 {
35269 }
35270 }
35271 }
35273 {
35274 if ((
double)
num54 > 3.14)
35275 {
35277 }
35278 else
35279 {
35282 {
35284 }
35285 }
35286 }
35287 }
35290 }
35292 {
35294 if (this.ai[0] == 0
f)
35295 {
35301 {
35303 }
35305 {
35313 {
35315 }
35317 {
35319 }
35321 {
35323 }
35326 {
35327 velocity.Y *= 0.5f;
35328 }
35334 {
35336 }
35338 {
35340 }
35342 {
35344 }
35346 {
35349 }
35350 else if (Main.tile[
num60,
num61].liquid > 0)
35351 {
35354 }
35355 else if (Main.tile[
num60,
num61 + 1].liquid > 0)
35356 {
35359 }
35362 {
35363 velocity.Y -= 0.1f;
35365 {
35367 }
35369 {
35371 }
35372 }
35373 else
35374 {
35376 }
35377 }
35378 if (Main.netMode == 1)
35379 {
35380 return;
35381 }
35383 {
35387 return;
35388 }
35393 {
35398 }
35399 }
35400 else
35401 {
35402 if (Main.player[
target].dead)
35403 {
35404 return;
35405 }
35408 if (this.ai[1] >= 300
f)
35409 {
35411 }
35413 {
35415 {
35420 if (Main.netMode != 1)
35421 {
35423 {
35429 this.ai[1] = 200 + Main.rand.Next(200);
35430 }
35432 }
35433 }
35434 else
35435 {
35436 velocity.X *= 0.98f;
35437 velocity.Y += 0.1f;
35439 {
35441 }
35442 }
35443 return;
35444 }
35446 {
35448 velocity.X = oldVelocity.X * -0.5f;
35450 {
35452 }
35454 {
35456 }
35457 }
35459 {
35460 velocity.Y = oldVelocity.Y * -0.5f;
35462 {
35464 }
35466 {
35468 }
35469 }
35471 {
35472 velocity.X -= 0.1f;
35474 {
35475 velocity.X -= 0.1f;
35476 }
35478 {
35479 velocity.X -= 0.05f;
35480 }
35482 {
35484 }
35485 }
35487 {
35488 velocity.X += 0.1f;
35490 {
35491 velocity.X += 0.1f;
35492 }
35494 {
35495 velocity.X += 0.05f;
35496 }
35498 {
35500 }
35501 }
35508 {
35510 {
35512 }
35514 {
35516 {
35518 }
35520 break;
35521 }
35522 }
35524 {
35525 velocity.Y += 0.1f;
35526 }
35527 else
35528 {
35529 velocity.Y -= 0.1f;
35530 }
35532 {
35533 velocity.Y -= 0.2f;
35534 }
35536 {
35538 }
35540 {
35542 }
35543 }
35544 }
35546 {
35548 }
35550 {
35552 {
35554 this.ai[3] = (float)Main.rand.Next(80, 121) / 100
f;
35555 float num70 = (float)Main.rand.Next(165, 265) / 15
f;
35556 velocity = Vector2.Normalize(Main.player[
target].Center -
base.Center +
new Vector2((
float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101))) *
num70;
35558 }
35561 scale = this.ai[3];
35564 {
35566 }
35568 velocity.X = (velocity.X * 50
f + Main.windSpeedCurrent * 2
f + (float)Main.rand.Next(-10, 11) * 0.1f) / 51
f;
35569 velocity.Y = (velocity.Y * 50
f + -0.25f + (float)Main.rand.Next(-10, 11) * 0.2f) / 51
f;
35571 {
35572 velocity.Y -= 0.04f;
35573 }
35574 if (this.ai[0] == 0
f)
35575 {
35580 rect.Width +=
num71 * 2;
35581 rect.Height +=
num71 * 2;
35583 {
35586 {
35590 break;
35591 }
35592 }
35593 }
35594 if (this.ai[0] == 0
f)
35595 {
35596 this.ai[1]++;
35597 if (this.ai[1] >= 150
f)
35598 {
35601 }
35602 }
35603 if (this.ai[0] == 1
f)
35604 {
35605 this.ai[1]--;
35606 if (this.ai[1] <= 0
f)
35607 {
35611 return;
35612 }
35613 }
35615 {
35621 }
35622 }
35624 {
35628 {
35632 }
35633 if (this.ai[0] == 0
f)
35634 {
35635 this.ai[1]++;
35639 velocity.Y = this.ai[3];
35641 {
35643 float num75 = this.ai[2];
35650 {
35652 }
35655 {
35657 }
35659 {
35661 }
35664 {
35666 }
35667 }
35668 if (this.ai[1] >= (
float)
num73)
35669 {
35673 {
35675 }
35684 {
35686 }
35688 }
35689 }
35690 else
35691 {
35692 if (this.ai[0] != 1
f)
35693 {
35694 return;
35695 }
35698 {
35699 if (this.ai[1] < 1
f)
35700 {
35702 }
35703 }
35704 else
35705 {
35708 {
35710 }
35711 }
35712 if (this.ai[1] >= 1
f)
35713 {
35716 {
35718 }
35720 this.ai[1]++;
35722 {
35724 {
35726 }
35730 return;
35731 }
35732 }
35733 if (this.ai[1] >= 60
f)
35734 {
35736 }
35739 {
35741 }
35742 }
35743 }
35745 {
35747 {
35748 int num77 = (int)this.ai[0];
35749 if (Main.npc[
num77].active && Main.npc[
num77].type == 383)
35750 {
35753 position.X -=
width / 2;
35754 position.Y -=
height / 2;
35756 Lighting.AddLight((
int)base.Center.X / 16, (int)
base.Center.Y / 16, 0.1f, 0.5f, 0.7f);
35757 }
35758 else
35759 {
35763 }
35764 }
35765 }
35767 {
35770 velocity.X *= 0.93f;
35772 {
35774 }
35776 {
35779 if (this.ai[1] <
num78)
35780 {
35781 this.ai[1]++;
35782 if (this.ai[1] > 60
f)
35783 {
35786 }
35787 else
35788 {
35790 }
35793 frame.Y = 0;
35799 val29 =
default(Vector2);
35802 {
35806 {
35809 }
35811 {
35814 }
35816 {
35819 }
35821 {
35824 }
35828 Main.dust[
num85].noGravity =
true;
35830 Main.dust[
num85].velocity = Vector2.Zero;
35835 Main.dust[
num85].noGravity =
true;
35837 Main.dust[
num85].velocity = Vector2.Zero;
35838 }
35839 Lighting.AddLight((
int)
base.Center.X / 16, (
int)(
base.Center.Y - 10
f) / 16, 0.1f *
num82, 0.5f *
num82, 0.7f *
num82);
35840 return;
35841 }
35842 if (this.ai[1] ==
num78)
35843 {
35844 this.ai[1]++;
35846 }
35847 Lighting.AddLight((
int)
base.Center.X / 16, (
int)(
base.Center.Y - 10
f) / 16, 0.1f, 0.5f, 0.7f);
35849 }
35850 if (this.ai[0] < 60
f)
35851 {
35852 this.ai[0]++;
35853 }
35855 {
35858 }
35859 if (this.ai[0] == 60
f && Main.netMode != 1)
35860 {
35861 this.ai[0] = -120
f;
35864 Vector2
vector44 = base.Center - Vector2.UnitY * 10
f;
35866 vector45.X += Main.rand.Next(-100, 101);
35867 vector45.Y += Main.rand.Next(-100, 101);
35868 vector45.X *= (float)Main.rand.Next(70, 131) * 0.01f;
35869 vector45.Y *= (float)Main.rand.Next(70, 131) * 0.01f;
35872 {
35874 }
35879 {
35881 }
35884 }
35885 }
35887 {
35891 {
35893 }
35895 {
35897 }
35899 {
35901 }
35903 {
35905 }
35906 float num88 = 0.4f;
35914 float num97 = 0.95f;
35924 {
35942 }
35944 if (Main.expertMode)
35945 {
35946 num88 *= Main.GameModeInfo.KnockbackToEnemiesMultiplier;
35947 }
35948 if (
type == 388 && this.ai[0] != 3
f)
35949 {
35956 Main.dust[
num106].noGravity =
true;
35961 {
35962 spinningpoint5.X *= -1
f;
35963 }
35966 val29 =
default(Vector2);
35970 }
35972 {
35973 int num107 = ((this.ai[0] != 2
f) ? 1 : 2);
35974 int num108 = ((this.ai[0] == 2
f) ? 30 : 20);
35976 {
35977 if (Main.rand.Next(3) <
num107)
35978 {
35980 Vector2
val66 = base.Center -
new Vector2((
float)
num108);
35983 float speedX25 = velocity.X * 0.5f;
35984 float speedY24 = velocity.Y * 0.5f;
35987 Main.dust[
num110].noGravity =
true;
35990 dust87.velocity *= 0.2f;
35991 Main.dust[
num110].fadeIn = 1
f;
35993 }
35994 }
35995 }
35996 if (this.ai[0] == 0
f)
35997 {
36008 bool flag66 = Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1);
36009 if (this.ai[3] >= 120
f)
36010 {
36012 }
36018 {
36022 {
36024 {
36025 this.ai[3]++;
36026 }
36027 if (this.ai[3] == 120
f)
36028 {
36030 }
36031 }
36032 else
36033 {
36035 }
36036 }
36037 else
36038 {
36043 }
36044 }
36045 else if (this.ai[0] == 1
f)
36046 {
36050 {
36053 {
36054 Vector2
value = (Main.player[
target].Center -
base.Center).SafeNormalize(Vector2.Zero) * 0.1f;
36056 }
36057 }
36059 {
36061 }
36062 this.ai[1]++;
36063 if (this.ai[1] >=
num96)
36064 {
36068 Vector2
vector49 =
new Vector2(this.ai[2], this.ai[3]) +
new Vector2((
float)Main.rand.Next(-
num98,
num98 + 1), (
float)Main.rand.Next(-
num98,
num98 + 1)) * 0.04f;
36071 }
36072 if (
type == 388 && Main.rand.Next(4) == 0)
36073 {
36080 Main.dust[
num116].noGravity =
true;
36083 dust87.velocity *= 2
f;
36084 Main.dust[
num116].velocity = Main.dust[
num116].velocity / 2
f + Vector2.Normalize(Main.dust[
num116].position -
base.Center);
36086 }
36087 }
36088 else if (this.ai[0] == 2
f)
36089 {
36092 this.ai[1]++;
36095 {
36103 {
36106 }
36107 }
36108 else
36109 {
36115 {
36117 }
36119 }
36121 {
36127 }
36128 }
36129 else if (this.ai[0] == 4
f)
36130 {
36132 if (this.ai[1] <= 0
f)
36133 {
36137 }
36139 }
36140 if (
flag65 && this.ai[0] != 3
f && Vector2.Distance(
base.Center, Main.player[
target].Center) < 64
f)
36141 {
36147 }
36148 if (this.ai[0] != 3
f)
36149 {
36150 return;
36151 }
36154 position.X -=
width / 2;
36155 position.Y -=
height / 2;
36159 Lighting.AddLight((
int)
base.Center.X / 16, (
int)
base.Center.Y / 16, 0.2f, 0.7f, 1.1f);
36161 {
36169 dust87.velocity *= 1.4f;
36170 Main.dust[
num119].position = ((float)Main.rand.NextDouble() * ((float)
Math.PI * 2
f)).ToRotationVector2() * ((float)Main.rand.NextDouble() * 96
f) +
base.Center;
36171 }
36173 {
36179 Main.dust[
num121].noGravity =
true;
36182 dust87.velocity *= 2
f;
36183 Main.dust[
num121].position = ((float)Main.rand.NextDouble() * ((float)
Math.PI * 2
f)).ToRotationVector2() * ((float)Main.rand.NextDouble() * 96
f) +
base.Center;
36184 Main.dust[
num121].velocity = Main.dust[
num121].velocity / 2
f + Vector2.Normalize(Main.dust[
num121].position -
base.Center);
36185 if (Main.rand.Next(2) == 0)
36186 {
36192 Main.dust[
num121].noGravity =
true;
36195 dust87.velocity *= 1.2f;
36196 Main.dust[
num121].position = ((float)Main.rand.NextDouble() * ((float)
Math.PI * 2
f)).ToRotationVector2() * ((float)Main.rand.NextDouble() * 96
f) +
base.Center;
36197 Main.dust[
num121].velocity = Main.dust[
num121].velocity / 2
f + Vector2.Normalize(Main.dust[
num121].position -
base.Center);
36198 }
36199 if (Main.rand.Next(4) == 0)
36200 {
36208 dust87.velocity *= 1.2f;
36209 Main.dust[
num121].position = ((float)Main.rand.NextDouble() * ((float)
Math.PI * 2
f)).ToRotationVector2() * ((float)Main.rand.NextDouble() * 96
f) +
base.Center;
36210 Main.dust[
num121].velocity = Main.dust[
num121].velocity / 2
f + Vector2.Normalize(Main.dust[
num121].position -
base.Center);
36211 }
36212 }
36213 this.ai[1]++;
36214 if (this.ai[1] >= 3
f)
36215 {
36220 }
36221 }
36223 {
36228 {
36229 if (
localAI[0] == 0
f && Main.netMode != 1)
36230 {
36235 }
36236 int num126 = (int)this.ai[0];
36237 if (Main.npc[
num126].active && Main.npc[
num126].type == 391)
36238 {
36242 }
36243 }
36245 {
36246 if (
localAI[0] == 0
f && Main.netMode != 1)
36247 {
36252 }
36253 int num128 = (int)this.ai[0];
36254 if (Main.npc[
num128].active && Main.npc[
num128].type == 415)
36255 {
36259 }
36260 }
36261 else if (
type == 392)
36262 {
36263 int num129 = (int)this.ai[0];
36264 if (Main.npc[
num129].active && Main.npc[
num129].type == 395)
36265 {
36273 val29 =
default(Vector2);
36276 if (Main.netMode != 1)
36277 {
36279 if (Main.npc[
num129].ai[0] >= 1
f || Main.npc[
num129].ai[0] < 0
f)
36280 {
36282 }
36284 {
36286 {
36288 {
36290 }
36291 }
36293 {
36295 {
36297 }
36298 }
36299 }
36300 if (Main.npc[
num129].ai[3] % 200
f == 0
f && Main.npc[
num129].ai[0] != 1
f)
36301 {
36303 {
36305 {
36307 }
36308 }
36310 {
36312 {
36314 }
36315 }
36317 }
36319 {
36320 if (!Main.expertMode)
36321 {
36326 Main.npc[
num129].netUpdate =
true;
36327 }
36328 else
36329 {
36334 Main.npc[
num129].netUpdate =
true;
36335 }
36336 }
36337 }
36338 }
36339 }
36340 else if (
type == 393)
36341 {
36342 int num135 = (int)this.ai[0];
36343 if (Main.npc[
num135].active && Main.npc[
num135].type == 395)
36344 {
36347 vector51 = Vector2.UnitY * 29
f + ((this.ai[1] == 1
f) ? Vector2.UnitX : (-Vector2.
UnitX)) * 60
f;
36352 val29 =
default(Vector2);
36355 }
36356 }
36357 else if (
type == 394)
36358 {
36359 int num138 = (int)this.ai[0];
36360 if (Main.npc[
num138].active && Main.npc[
num138].type == 395)
36361 {
36364 vector51 = Vector2.UnitY * -13
f + ((this.ai[1] == 1
f) ? Vector2.UnitX : (-Vector2.
UnitX)) * 49
f;
36369 val29 =
default(Vector2);
36372 num123 = ((this.ai[1] == 1
f) ? 1 : (-1));
36373 }
36374 }
36375 else if (
type == 492)
36376 {
36377 int num140 = (int)this.ai[0];
36378 if (Main.npc[
num140].active && Main.npc[
num140].type == 491)
36379 {
36387 val29 =
default(Vector2);
36390 }
36391 }
36393 {
36397 position.X -=
width / 2;
36398 position.Y -=
height / 2;
36403 {
36405 }
36406 else
36407 {
36409 }
36411 {
36415 if (this.ai[1] < 60
f)
36416 {
36417 this.ai[1]++;
36418 }
36420 {
36422 }
36427 {
36433 {
36435 }
36437 {
36439 }
36441 {
36443 {
36446 Vector2
vector54 = base.Center - Vector2.UnitY * 4
f;
36448 vector55.X += Main.rand.Next(-50, 51);
36449 vector55.Y += Main.rand.Next(-50, 51);
36450 vector55.X *= (float)Main.rand.Next(80, 121) * 0.01f;
36451 vector55.Y *= (float)Main.rand.Next(80, 121) * 0.01f;
36454 {
36456 }
36460 }
36461 else
36462 {
36463 float num148 = this.ai[2];
36464 velocity.X *= 0.5f;
36467 {
36469 {
36471 }
36472 else
36473 {
36475 }
36476 }
36478 {
36480 }
36482 {
36484 }
36485 else
36486 {
36488 }
36489 if (this.ai[2] !=
num148)
36490 {
36492 }
36493 }
36494 }
36495 }
36496 }
36498 {
36501 if (this.ai[3] < 240
f)
36502 {
36503 this.ai[3]++;
36504 }
36505 if (this.ai[3] == 2
f)
36506 {
36508 }
36510 {
36513 if (this.ai[3] >= 240
f)
36514 {
36520 {
36522 }
36525 if (Main.netMode != 1)
36526 {
36528 }
36530 }
36531 else
36532 {
36533 float num149 = this.ai[2];
36534 float[]
array3 =
new float[8];
36536 {
36539 Vector2
unitY = Vector2.UnitY;
36541 val29 =
default(Vector2);
36543 }
36546 {
36548 {
36550 }
36551 }
36552 this.ai[2] =
num151 + 1;
36554 {
36555 this.ai[2] = 9
f - this.ai[2];
36556 }
36557 if (this.ai[2] !=
num149)
36558 {
36560 }
36561 }
36562 }
36563 else
36564 {
36565 if (this.ai[2] != 0
f)
36566 {
36568 }
36570 }
36571 }
36573 {
36576 this.ai[3] =
nPC18.ai[3];
36580 {
36583 {
36584 if (Main.netMode != 1)
36585 {
36588 double radians9 = (Main.rand.NextDouble() - 0.5) * 0.7853981852531433;
36589 val29 =
default(Vector2);
36593 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector60.X,
vector60.Y,
spinningpoint6.X,
spinningpoint6.Y, 448,
attackDamage_ForProjectiles12, 0
f, Main.myPlayer, 0
f, 20
f);
36594 }
36596 }
36597 }
36598 }
36600 {
36603 this.ai[3] =
nPC18.ai[3];
36608 {
36611 Vector2
v6 = player9.Center -
base.Center;
36613 {
36615 }
36617 if (
float.
IsNaN(
v6.X) ||
float.IsNaN(
v6.Y))
36618 {
36619 v6 = Vector2.UnitY;
36620 }
36621 this.ai[2] =
v6.ToRotation();
36622 }
36624 {
36627 {
36628 if (Main.netMode != 1)
36629 {
36632 double radians10 = (Main.rand.NextDouble() - 0.5) * 0.7853981852531433 / 3.0;
36633 val29 =
default(Vector2);
36638 }
36640 }
36641 }
36642 }
36644 {
36645 return;
36646 }
36649 this.ai[3] =
nPC18.ai[3];
36653 {
36656 {
36657 if (Main.netMode != 1)
36658 {
36661 }
36663 }
36664 }
36671 {
36675 }
36677 {
36682 {
36685 }
36686 }
36688 {
36693 {
36696 }
36697 }
36703 {
36705 }
36707 {
36709 }
36711 {
36713 }
36715 {
36717 }
36719 {
36722 {
36723 if (Main.netMode != 1)
36724 {
36728 double radians11 = (Main.rand.NextDouble() - 0.5) * 0.7853981852531433;
36729 val29 =
default(Vector2);
36732 Vector2
vector62 = -1
f * Vector2.UnitX * (float)Main.rand.Next(50, 70) + base.Center + Vector2.UnitY * (float)Main.rand.Next(30, 45);
36734 }
36736 }
36738 {
36739 if (Main.netMode != 1)
36740 {
36744 double radians12 = (Main.rand.NextDouble() - 0.5) * 0.7853981852531433;
36745 val29 =
default(Vector2);
36748 Vector2
vector63 = 1
f * Vector2.UnitX * (float)Main.rand.Next(50, 70) + base.Center + Vector2.UnitY * (float)Main.rand.Next(30, 45);
36750 }
36752 }
36753 }
36755 {
36758 {
36759 if (Main.netMode != 1)
36760 {
36764 double radians13 = (Main.rand.NextDouble() - 0.5) * 0.7853981852531433;
36765 val29 =
default(Vector2);
36768 Vector2
vector64 = -1
f * Vector2.UnitX * (float)Main.rand.Next(30, 60) + base.Center + Vector2.UnitY * (float)Main.rand.Next(-30, -10);
36770 }
36772 }
36774 {
36775 if (Main.netMode != 1)
36776 {
36780 double radians14 = (Main.rand.NextDouble() - 0.5) * 0.7853981852531433;
36781 val29 =
default(Vector2);
36784 Vector2
vector65 = 1
f * Vector2.UnitX * (float)Main.rand.Next(30, 60) + base.Center + Vector2.UnitY * (float)Main.rand.Next(-30, -10);
36786 }
36788 }
36789 }
36790 if (
flag75 && Main.rand.Next(8) == 0)
36791 {
36792 Vector2
val72 = -1
f * Vector2.UnitX * (float)Main.rand.Next(50, 70) + base.Center + Vector2.UnitY * (float)Main.rand.Next(15, 30);
36793 int num1723 = ((Main.rand.Next(4) != 0) ? 31 : 228);
36797 Vector2
spinningpoint27 =
new Vector2(-1
f * (
float)Main.rand.NextDouble() * 3
f, 1
f);
36798 double radians15 = (Main.rand.NextDouble() - 0.5) * 0.7853981852531433;
36799 val29 =
default(Vector2);
36803 dust87.velocity *= 0.5f;
36805 }
36806 if (
flag76 && Main.rand.Next(8) == 0)
36807 {
36808 Vector2
val73 = Vector2.UnitX * (float)Main.rand.Next(50, 70) + base.Center + Vector2.UnitY * (float)Main.rand.Next(15, 30);
36809 int num1724 = ((Main.rand.Next(4) != 0) ? 31 : 228);
36814 double radians16 = (Main.rand.NextDouble() - 0.5) * 0.7853981852531433;
36815 val29 =
default(Vector2);
36819 dust87.velocity *= 0.5f;
36821 }
36822 if (
flag77 && Main.rand.Next(8) == 0)
36823 {
36824 Vector2
val74 = -1
f * Vector2.UnitX * (float)Main.rand.Next(30, 60) + base.Center + Vector2.UnitY * (float)Main.rand.Next(-30, -10);
36825 int num1725 = ((Main.rand.Next(4) != 0) ? 31 : 228);
36829 Vector2
spinningpoint29 =
new Vector2(-1
f * (
float)Main.rand.NextDouble() * 2
f, 1
f);
36830 double radians17 = (Main.rand.NextDouble() - 0.5) * 0.7853981852531433;
36831 val29 =
default(Vector2);
36835 dust87.velocity *= 0.5f;
36837 }
36838 if (
flag78 && Main.rand.Next(8) == 0)
36839 {
36840 Vector2
val75 = Vector2.UnitX * (float)Main.rand.Next(30, 60) + base.Center + Vector2.UnitY * (float)Main.rand.Next(-30, -10);
36841 int num1726 = ((Main.rand.Next(4) != 0) ? 31 : 228);
36846 double radians18 = (Main.rand.NextDouble() - 0.5) * 0.7853981852531433;
36847 val29 =
default(Vector2);
36851 dust87.velocity *= 0.5f;
36853 }
36854 }
36855 else if (
type == 390)
36856 {
36858 }
36859 else if (
type == 416)
36860 {
36862 }
36863 else
36864 {
36868 }
36869 }
36871 {
36872 if (
localAI[3] == 0
f && Main.netMode != 1 &&
type == 395)
36873 {
36875 int[]
array4 =
new int[4];
36878 {
36881 Main.npc[
num171].netUpdate =
true;
36883 }
36885 {
36888 Main.npc[
num173].netUpdate =
true;
36890 }
36893 Main.npc[
num174].netUpdate =
true;
36895 {
36897 }
36899 {
36901 }
36902 }
36903 if (this.ai[0] == 3
f)
36904 {
36906 return;
36907 }
36912 {
36916 }
36918 {
36919 if (this.ai[0] == 0
f)
36920 {
36922 }
36923 if (this.ai[0] == 2
f)
36924 {
36926 }
36928 }
36929 if (this.ai[0] == -1
f || this.ai[0] == -2
f)
36930 {
36931 velocity.Y -= 0.4f;
36934 {
36936 if (this.ai[0] == -2
f)
36937 {
36939 }
36940 if (this.ai[0] == 0
f)
36941 {
36943 }
36948 }
36949 }
36950 else if (this.ai[0] == 0
f)
36951 {
36954 if (this.ai[3] >= 580
f)
36955 {
36957 }
36958 else if (this.ai[3] >= 440
f)
36959 {
36961 }
36962 else if (this.ai[3] >= 420
f)
36963 {
36965 }
36966 else if (this.ai[3] >= 280
f)
36967 {
36969 }
36970 else if (this.ai[3] >= 260
f)
36971 {
36973 }
36974 else if (this.ai[3] >= 20
f)
36975 {
36977 }
36978 this.ai[3]++;
36979 if (this.ai[3] >= 600
f)
36980 {
36982 }
36984 if (this.ai[3] >= 580
f)
36985 {
36987 }
36988 else if (this.ai[3] >= 440
f)
36989 {
36991 }
36992 else if (this.ai[3] >= 420
f)
36993 {
36995 }
36996 else if (this.ai[3] >= 280
f)
36997 {
36999 }
37000 else if (this.ai[3] >= 260
f)
37001 {
37003 }
37004 else if (this.ai[3] >= 20
f)
37005 {
37007 }
37009 {
37011 {
37013 }
37015 {
37017 }
37019 {
37021 }
37023 }
37025 {
37026 if (this.ai[2] == 0
f)
37027 {
37029 }
37030 Vector2
vector66 = player10.Center +
new Vector2(this.ai[2], -250
f) -
center6;
37032 {
37034 }
37035 else
37036 {
37039 }
37040 }
37042 {
37047 {
37049 }
37050 else
37051 {
37053 {
37056 {
37058 break;
37059 }
37060 }
37061 }
37065 {
37068 {
37070 }
37072 }
37073 else
37074 {
37075 velocity.Y *= 0.95f;
37076 }
37077 velocity.X = 3.5f * this.ai[2];
37078 }
37080 {
37081 case 2:
37082 {
37083 if (this.ai[2] == 0
f)
37084 {
37086 }
37087 Vector2
vector67 = player10.Center +
new Vector2(this.ai[2], -170
f) -
center6;
37092 {
37094 }
37095 else
37096 {
37098 {
37101 {
37103 break;
37104 }
37105 }
37106 }
37110 {
37112 }
37114 {
37116 break;
37117 }
37120 break;
37121 }
37122 case 3:
37123 {
37129 {
37131 }
37132 else
37133 {
37135 {
37138 {
37140 break;
37141 }
37142 }
37143 }
37147 {
37150 {
37152 }
37154 }
37155 else
37156 {
37158 }
37160 break;
37161 }
37162 }
37164 {
37165 case 4:
37166 {
37169 {
37171 break;
37172 }
37175 break;
37176 }
37177 case 5:
37179 break;
37180 }
37181 }
37182 else if (this.ai[0] == 1
f)
37183 {
37187 this.ai[1]++;
37188 if (this.ai[1] >=
num204)
37189 {
37194 }
37195 else if (this.ai[1] < 40
f)
37196 {
37197 Vector2
unitY2 = Vector2.UnitY;
37199 val29 =
default(Vector2);
37201 }
37202 else if (this.ai[1] < 80
f)
37203 {
37204 Vector2
unitY3 = Vector2.UnitY;
37206 val29 =
default(Vector2);
37208 }
37209 else if (this.ai[1] < 120
f)
37210 {
37211 Vector2
unitY4 = Vector2.UnitY;
37213 val29 =
default(Vector2);
37215 }
37216 else
37217 {
37218 rotation = (this.ai[1] - 120
f) / 30
f * ((
float)Math.PI * 2
f);
37219 }
37220 }
37221 else if (this.ai[0] == 2
f)
37222 {
37229 {
37231 }
37234 this.ai[3]++;
37236 {
37238 }
37240 {
37242 {
37244 if (Main.netMode != 1)
37245 {
37248 }
37250 }
37252 }
37253 if (this.ai[3] >=
num206)
37254 {
37260 }
37262 {
37263 Vector2
vector70 = player10.Center +
new Vector2(this.ai[2] * 350
f, -250
f) -
center6;
37266 }
37267 else
37268 {
37273 {
37275 }
37276 else
37277 {
37279 {
37282 {
37284 break;
37285 }
37286 }
37287 }
37291 {
37294 {
37296 }
37298 }
37299 else
37300 {
37301 velocity.Y *= 0.95f;
37302 }
37303 velocity.X = 8
f * this.ai[2];
37304 }
37306 }
37309 {
37311 }
37313 {
37315 }
37316 if (
position.Y > (
float)(Main.maxTilesY * 16 + 100))
37317 {
37319 }
37320 if (
position.X > (
float)(Main.maxTilesX * 16 + 100))
37321 {
37323 }
37325 {
37326 position = Vector2.Clamp(
position,
new Vector2(-100
f),
new Vector2(100
f) +
new Vector2((
float)Main.maxTilesX, (
float)Main.maxTilesY) * 16
f);
37329 }
37330 }
37332 {
37333 if (this.ai[0] != -1
f && this.ai[0] != 2
f && Main.rand.Next(200) == 0)
37334 {
37336 }
37338 {
37342 }
37343 if (this.ai[0] == -2
f)
37344 {
37346 this.ai[1]++;
37347 if (this.ai[1] == 30
f)
37348 {
37350 }
37351 if (this.ai[1] < 60
f)
37352 {
37354 }
37355 if (this.ai[1] == 60
f)
37356 {
37359 if (Main.netMode != 1 &&
type == 398)
37360 {
37361 this.ai[2] = Main.rand.Next(3);
37364 }
37365 }
37366 }
37367 if (this.ai[0] == -1
f)
37368 {
37370 this.ai[1]++;
37371 if (this.ai[1] == 30
f)
37372 {
37374 }
37375 if (this.ai[1] < 60
f)
37376 {
37378 }
37379 if (this.ai[1] == 60
f)
37380 {
37383 if (Main.netMode != 1 &&
type == 398)
37384 {
37385 this.ai[2] = Main.rand.Next(3);
37388 int[]
array5 =
new int[3];
37391 {
37394 Main.npc[
num221].netUpdate =
true;
37396 }
37398 Main.npc[
num222].netUpdate =
true;
37401 {
37403 }
37405 {
37407 }
37408 }
37409 }
37410 }
37411 if (this.ai[0] == 0
f)
37412 {
37415 Vector2
vector71 = Main.player[
target].Center - base.Center +
new Vector2(0
f, 130
f);
37417 {
37422 }
37423 if (Main.netMode != 1)
37424 {
37427 {
37429 }
37430 else if (!Main.npc[(
int)
localAI[0]].active || Main.npc[(
int)
localAI[0]].type != 397)
37431 {
37433 }
37434 else if (!Main.npc[(
int)
localAI[1]].active || Main.npc[(
int)
localAI[1]].type != 397)
37435 {
37437 }
37438 else if (!Main.npc[(
int)
localAI[2]].active || Main.npc[(
int)
localAI[2]].type != 396)
37439 {
37441 }
37443 {
37447 }
37449 if (Main.npc[(
int)
localAI[0]].ai[0] != -2
f)
37450 {
37452 }
37453 if (Main.npc[(
int)
localAI[1]].ai[0] != -2
f)
37454 {
37456 }
37457 if (Main.npc[(
int)
localAI[2]].ai[0] != -2
f)
37458 {
37460 }
37462 {
37466 }
37467 }
37468 }
37469 else if (this.ai[0] == 1
f)
37470 {
37473 Vector2
vector72 = Main.player[
target].Center - base.Center +
new Vector2(0
f, 130
f);
37475 {
37480 }
37481 }
37482 else if (this.ai[0] == 2
f)
37483 {
37487 this.ai[1]++;
37488 if (this.ai[1] < 60
f)
37489 {
37491 }
37492 if (this.ai[1] == 60
f)
37493 {
37495 {
37496 Projectile projectile = Main.projectile[
num227];
37497 if (projectile.active && (projectile.type == 456 || projectile.type == 462 || projectile.type == 455 || projectile.type == 452 || projectile.type == 454))
37498 {
37499 projectile.Kill();
37500 }
37501 }
37503 {
37506 {
37507 nPC19.HitEffect(0, 9999.0);
37508 nPC19.active = false;
37509 }
37510 }
37511 }
37512 if (this.ai[1] % 3
f == 0
f && this.ai[1] < 580
f && this.ai[1] > 60
f)
37513 {
37514 Vector2
vector73 = Utils.RandomVector2(Main.rand, -1
f, 1
f);
37516 {
37518 }
37519 vector73 *= 20
f + Main.rand.NextFloat() * 400
f;
37524 {
37526 }
37528 {
37530 }
37531 float num229 = Main.rand.Next(6, 19);
37533 float num231 = (float)
Math.PI * 2
f * Main.rand.NextFloat();
37534 float num232 = 1
f + Main.rand.NextFloat() * 2
f;
37535 float num233 = 1
f + Main.rand.NextFloat();
37536 float fadeIn = 0.4f + Main.rand.NextFloat();
37537 int num234 = Utils.SelectRandom<
int>(Main.rand, 31, 229);
37538 if (
flag85 && !Main.dedServ)
37539 {
37542 {
37543 Dust[]
dust88 = Main.dust;
37546 dust83.noGravity = true;
37548 Vector2
unitY5 = Vector2.UnitY;
37550 val29 =
default(Vector2);
37552 dust83.fadeIn = fadeIn;
37554 }
37555 }
37557 {
37558 Vector2
vector75 = Utils.RandomVector2(Main.rand, -1
f, 1
f);
37560 {
37562 }
37563 vector75 *= 20
f + Main.rand.NextFloat() * 800
f;
37568 {
37570 }
37572 {
37574 }
37576 {
37577 Dust[]
dust89 = Main.dust;
37580 dust84.noGravity = true;
37581 dust84.position =
vec;
37582 dust84.velocity = -Vector2.UnitY *
num232 * (Main.rand.NextFloat() * 0.9f + 1.6f);
37583 dust84.fadeIn = fadeIn;
37585 }
37586 }
37587 }
37588 if (this.ai[1] % 15
f == 0
f && this.ai[1] < 480
f && this.ai[1] >= 90
f && Main.netMode != 1)
37589 {
37590 Vector2
vector76 = Utils.RandomVector2(Main.rand, -1
f, 1
f);
37592 {
37594 }
37595 vector76 *= 20
f + Main.rand.NextFloat() * 400
f;
37600 {
37602 }
37604 {
37606 }
37608 {
37609 float num238 = (float)(Main.rand.Next(4) < 2).ToDirectionInt() * ((float)
Math.PI / 8
f + (
float)Math.PI / 4
f * Main.rand.NextFloat());
37610 Vector2
spinningpoint31 =
new Vector2(0
f, (0
f - Main.rand.NextFloat()) * 0.5f - 0.5f);
37612 val29 =
default(Vector2);
37615 }
37616 }
37617 if (this.ai[1] == 1
f)
37618 {
37620 }
37621 if (this.ai[1] >= 480
f)
37622 {
37624 }
37625 if (this.ai[1] >= 600
f)
37626 {
37630 return;
37631 }
37632 }
37633 else if (this.ai[0] == 3
f)
37634 {
37638 this.ai[1]++;
37639 if (this.ai[1] < 60
f)
37640 {
37642 }
37643 if (this.ai[1] == 40
f)
37644 {
37646 {
37649 {
37650 projectile5.active = false;
37651 if (Main.netMode != 1)
37652 {
37653 NetMessage.SendData(27, -1, -1,
null,
num239);
37654 }
37655 }
37656 }
37658 {
37661 {
37662 nPC20.active = false;
37663 if (Main.netMode != 1)
37664 {
37665 NetMessage.SendData(23, -1, -1,
null,
nPC20.whoAmI);
37666 }
37667 }
37668 }
37670 {
37673 {
37674 gore3.active = false;
37675 }
37676 }
37677 }
37678 if (this.ai[1] >= 60
f)
37679 {
37681 {
37684 {
37685 nPC21.active = false;
37686 if (Main.netMode != 1)
37687 {
37688 NetMessage.SendData(23, -1, -1,
null,
nPC21.whoAmI);
37689 }
37690 }
37691 }
37693 if (Main.netMode != 1)
37694 {
37695 NetMessage.SendData(23, -1, -1,
null,
whoAmI);
37696 }
37698 if (Main.netMode == 2)
37699 {
37700 NetMessage.SendData(7);
37701 }
37702 return;
37703 }
37704 }
37706 if (this.ai[0] == -2
f || this.ai[0] == -1
f || this.ai[0] == 2
f || this.ai[0] == 3
f)
37707 {
37709 }
37710 if (Main.player[
target].active && !Main.player[
target].dead)
37711 {
37713 }
37715 {
37717 {
37718 if (Main.player[
num243].active && !Main.player[
num243].dead)
37719 {
37721 break;
37722 }
37723 }
37724 }
37726 {
37730 }
37731 if (!(this.ai[0] >= 0
f) || !(this.ai[0] < 2
f) || Main.netMode == 1 || !(
Distance(Main.player[
target].Center) > 2400
f))
37732 {
37733 return;
37734 }
37739 if (Main.npc[(
int)
localAI[0]].active)
37740 {
37745 }
37746 if (Main.npc[(
int)
localAI[1]].active)
37747 {
37752 }
37753 if (Main.npc[(
int)
localAI[2]].active)
37754 {
37759 }
37761 {
37764 {
37768 nPC22.netUpdate = true;
37769 }
37770 }
37771 }
37773 {
37775 if (!Main.npc[(int)this.ai[3]].active || Main.npc[(int)this.ai[3]].type != 398)
37776 {
37780 }
37781 bool flag89 = this.ai[2] == 0
f;
37785 {
37787 }
37789 Vector2
vector80 =
default(Vector2);
37795 if (this.ai[0] != -2
f)
37796 {
37797 float num250 = this.ai[0];
37798 this.ai[1]++;
37799 int num251 = (int)Main.npc[(
int)this.ai[3]].ai[2];
37804 {
37807 {
37808 break;
37809 }
37811 }
37813 {
37818 }
37821 if (this.ai[0] !=
num250)
37822 {
37824 }
37825 }
37826 if (this.ai[0] == -2
f)
37827 {
37831 this.ai[1]++;
37832 if (this.ai[1] >= 32
f)
37833 {
37835 }
37836 if (this.ai[1] < 0
f)
37837 {
37839 }
37844 {
37849 {
37851 }
37853 }
37854 }
37855 else if (this.ai[0] == 0
f)
37856 {
37860 {
37862 }
37867 {
37872 {
37874 }
37876 }
37877 }
37878 else if (this.ai[0] == 1
f)
37879 {
37884 {
37887 {
37889 }
37890 }
37892 {
37895 {
37897 }
37901 {
37902 Vector2
vector85 =
default(Vector2);
37907 float ai = ((float)
Math.PI * 2
f * (
float)Main.rand.NextDouble() - (float)
Math.PI) / 30
f + (float)
Math.PI / 180
f *
num245;
37908 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector87.X,
vector87.Y,
vector88.X,
vector88.Y, 452, 30, 0
f, Main.myPlayer, 0
f,
ai);
37909 }
37910 }
37911 else
37912 {
37915 {
37917 }
37920 }
37921 }
37922 else if (this.ai[0] == 2
f)
37923 {
37926 {
37928 }
37932 Vector2
vector91 =
default(Vector2);
37935 {
37938 {
37942 }
37943 }
37945 {
37948 if (
num260 % 30 == 0 && Main.netMode != 1)
37949 {
37950 Vector2
vector94 =
default(Vector2);
37954 vector94.Y += ((float)
num261 - 4.5
f) * 1
f;
37956 int num262 = Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
vector94.X,
vector94.Y, 454, 40, 1
f, Main.myPlayer, 0
f,
whoAmI);
37957 }
37960 {
37964 }
37965 }
37967 {
37970 }
37972 {
37975 }
37977 {
37980 }
37982 {
37984 if (
num246 == 292
f && Main.netMode != 1)
37985 {
37987 Vector2
vector97 = Vector2.Normalize(Main.player[
num263].Center - (
base.Center + Vector2.UnitY * -350
f));
37989 {
37991 }
37994 {
37997 {
38000 projectile6.netUpdate = true;
38001 NetMessage.SendData(27, -1, -1,
null,
num264);
38002 }
38003 }
38004 }
38007 {
38011 }
38012 }
38013 else
38014 {
38018 {
38022 }
38023 }
38024 }
38025 else if (this.ai[0] == 3
f)
38026 {
38028 {
38031 }
38032 Vector2
v7 = Main.player[
target].Center + Main.player[
target].velocity * 20
f -
base.Center;
38036 {
38038 }
38040 {
38042 }
38044 {
38048 }
38049 }
38051 {
38057 {
38059 }
38061 {
38063 }
38066 {
38068 }
38069 }
38072 {
38074 }
38076 {
38078 }
38080 {
38082 }
38084 {
38086 }
38089 {
38091 }
38093 {
38094 case 1:
38095 if (this.ai[0] == 0
f)
38096 {
38097 if ((this.ai[1] += 1
f) >= 20
f)
38098 {
38102 }
38104 }
38105 else if (this.ai[0] == 1
f)
38106 {
38107 if ((this.ai[1] += 1
f) >= 20
f)
38108 {
38112 }
38114 }
38115 else if (this.ai[0] == 2
f || this.ai[0] == 4
f)
38116 {
38117 if ((this.ai[1] += 1
f) >= 20
f)
38118 {
38120 this.ai[0]++;
38122 }
38124 }
38125 else
38126 {
38127 if (this.ai[0] != 3
f && this.ai[0] != 5
f)
38128 {
38129 break;
38130 }
38131 if ((this.ai[1] += 1
f) >= 20
f)
38132 {
38134 this.ai[0]++;
38135 if (this.ai[0] == 6
f)
38136 {
38138 }
38140 }
38142 }
38143 break;
38144 case 2:
38145 {
38149 Vector2
v8 = Main.screenPosition +
new Vector2((
float)Main.mouseX, (
float)Main.mouseY) -
base.Center;
38152 {
38154 }
38158 {
38160 }
38164 break;
38165 }
38166 case 3:
38167 {
38170 this.ai[1]++;
38172 {
38174 break;
38175 }
38177 {
38180 {
38182 }
38183 break;
38184 }
38187 {
38189 }
38192 if (this.ai[1] % (
float)
num275 == 0
f)
38193 {
38199 float ai2 = ((float)
Math.PI * 2
f * (
float)Main.rand.NextDouble() - (float)
Math.PI) / 30
f + (float)
Math.PI / 180
f *
num245;
38200 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector123.X,
vector123.Y,
vector125.X,
vector125.Y, 452, 5, 0
f, Main.myPlayer, 0
f,
ai2);
38201 }
38202 break;
38203 }
38204 case 4:
38205 {
38211 this.ai[1]++;
38212 if (this.ai[1] < 30
f)
38213 {
38216 {
38220 }
38221 }
38222 else if (this.ai[1] < 210
f)
38223 {
38224 int num268 = (int)this.ai[1] - 30;
38225 if (
num268 % 30 == 0 && Main.netMode != 1)
38226 {
38231 vector115.Y += ((float)
num270 - 4.5
f) * 1
f;
38233 int num271 = Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
vector115.X,
vector115.Y, 454, 1, 1
f, Main.myPlayer, 0
f,
whoAmI);
38234 }
38237 {
38241 }
38242 }
38243 else if (this.ai[1] < 270
f)
38244 {
38246 }
38247 else if (this.ai[1] < 300
f)
38248 {
38249 if (this.ai[1] == 270
f && Main.netMode != 1)
38250 {
38252 Vector2
vector118 = Vector2.Normalize(Main.player[
num272].Center - (
base.Center + Vector2.UnitY * -350
f));
38254 {
38256 }
38259 {
38262 {
38265 projectile7.netUpdate = true;
38266 }
38267 }
38268 }
38271 {
38275 }
38276 }
38277 else
38278 {
38280 }
38281 break;
38282 }
38283 case 5:
38285 this.ai[1]++;
38286 if (this.ai[1] >= 40
f)
38287 {
38289 }
38290 break;
38291 }
38292 }
38294 {
38295 if (!Main.npc[(
int)this.ai[3]].active || Main.npc[(int)this.ai[3]].
type != 398)
38296 {
38300 }
38302 {
38304 }
38307 base.Center = Main.npc[(int)this.ai[3]].
Center +
new Vector2(0
f, -400
f);
38314 if (this.ai[0] >= 0
f)
38315 {
38316 float num282 = this.ai[0];
38317 this.ai[1]++;
38318 int num283 = (int)Main.npc[(
int)this.ai[3]].ai[2];
38323 {
38326 {
38327 break;
38328 }
38330 }
38332 {
38337 }
38340 if (this.ai[0] !=
num282)
38341 {
38343 }
38344 }
38345 if (this.ai[0] == -3
f)
38346 {
38350 this.ai[1]++;
38351 if (this.ai[1] >= 32
f)
38352 {
38354 }
38355 if (this.ai[1] < 0
f)
38356 {
38358 }
38360 {
38362 }
38363 }
38364 else if (this.ai[0] == -2
f)
38365 {
38366 if (Main.npc[(
int)this.ai[3]].ai[0] == 2
f)
38367 {
38369 return;
38370 }
38373 this.ai[1]++;
38374 if (this.ai[1] >= 32
f)
38375 {
38377 }
38378 if (this.ai[1] < 0
f)
38379 {
38381 }
38382 this.ai[2]++;
38383 if (this.ai[2] >= 555
f)
38384 {
38386 }
38387 if (this.ai[2] >= 120
f)
38388 {
38394 if (
num277 == 0
f && Main.netMode != 1)
38395 {
38398 {
38401 {
38404 {
38406 }
38407 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector128.X,
vector128.Y,
vector129.X,
vector129.Y, 456, 0, 0
f, Main.myPlayer,
whoAmI + 1,
num287);
38408 }
38409 }
38410 }
38412 {
38414 {
38417 {
38420 Main.npc[
num289].netUpdate =
true;
38423 }
38424 }
38425 }
38426 }
38427 }
38428 else if (this.ai[0] == 0
f)
38429 {
38432 Vector2
v9 = Main.player[
target].Center - base.Center -
new Vector2(0
f, -22
f);
38435 {
38437 }
38441 {
38443 }
38447 }
38448 if (this.ai[0] == 1
f)
38449 {
38451 {
38454 {
38456 }
38458 {
38462 {
38464 }
38466 {
38470 {
38473 }
38482 Main.dust[
num296].noGravity =
true;
38484 Main.dust[
num296].customData =
this;
38485 }
38486 }
38487 }
38489 {
38490 if (
num277 == 180
f && Main.netMode != 1)
38491 {
38497 {
38499 }
38502 val29 =
default(Vector2);
38504 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
spinningpoint12.X,
spinningpoint12.Y, 455, 75, 0
f, Main.myPlayer,
num297 * ((float)
Math.PI * 2
f) / 540
f,
whoAmI);
38507 }
38510 {
38512 }
38513 float num298 = (this.ai[2] >= 0
f).ToDirectionInt();
38514 float num299 = this.ai[2];
38516 {
38518 }
38523 }
38524 else
38525 {
38528 {
38530 if (Main.netMode != 1 && Main.getGoodWorld && Main.remixWorld)
38531 {
38533 {
38534 if (!
WorldGen.SolidTile((
int)(base.Center.X / 16
f), (
int)(base.Center.Y / 16
f)))
38535 {
38536 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y, (float)Main.rand.Next(-1599, 1600) * 0.01f, (float)Main.rand.Next(-1599, 1) * 0.01f, 1021, 70, 10
f);
38537 }
38538 }
38539 }
38540 }
38542 }
38543 }
38544 else if (this.ai[0] == 2
f)
38545 {
38550 if (
num277 == 0
f && Main.netMode != 1)
38551 {
38554 {
38557 {
38560 {
38562 }
38563 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector132.X,
vector132.Y,
vector133.X,
vector133.Y, 456, 0, 0
f, Main.myPlayer,
whoAmI + 1,
num301);
38564 }
38565 }
38566 }
38568 {
38570 {
38573 {
38576 Main.npc[
num304].netUpdate =
true;
38579 }
38580 }
38581 }
38582 }
38583 else if (this.ai[0] == 3
f)
38584 {
38585 if ((
double)
num277 == 1.0)
38586 {
38589 }
38594 {
38596 }
38598 {
38600 }
38602 {
38606 }
38607 }
38610 {
38612 }
38614 {
38616 }
38618 {
38620 }
38622 {
38624 }
38627 {
38629 }
38631 {
38633 }
38635 {
38637 }
38639 {
38641 }
38644 {
38648 Vector2
v11 = Main.screenPosition +
new Vector2((
float)Main.mouseX, (
float)Main.mouseY) -
base.Center;
38651 {
38653 }
38657 {
38659 }
38663 }
38665 {
38668 float num309 = (float)
Math.PI * 2
f * ((
float)Main.timeForVisualEffects % 600
f) / 600
f;
38671 if (this.ai[1] == 0
f)
38672 {
38675 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
vector139.X,
vector139.Y, 455, 1, 0
f, Main.myPlayer, (float)
Math.PI / 300
f,
whoAmI);
38676 }
38677 this.ai[1]++;
38678 if (this.ai[1] >= 600
f)
38679 {
38681 }
38682 }
38684 {
38687 if (this.ai[1] == 0
f)
38688 {
38692 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(), base.Center.X +
vector140.X, base.Center.Y +
vector140.Y,
vector141.X,
vector141.Y, 456, 0, 0
f, Main.myPlayer,
whoAmI + 1,
target);
38693 }
38694 this.ai[1]++;
38695 if (this.ai[1] >= 600
f)
38696 {
38698 }
38699 }
38701 {
38708 this.ai[1]++;
38709 if (this.ai[1] == 55
f)
38710 {
38712 }
38713 if (this.ai[1] == 76
f || this.ai[1] == 83
f || this.ai[1] == 90
f)
38714 {
38719 }
38720 if (this.ai[1] >= 90
f)
38721 {
38723 }
38724 }
38725 }
38727 {
38728 if (this.ai[0] == 0
f)
38729 {
38731 {
38734 }
38736 {
38739 }
38745 {
38747 {
38749 {
38751 break;
38752 }
38753 }
38754 }
38756 {
38758 }
38760 {
38761 velocity.Y *= 0.95f;
38762 }
38763 else
38764 {
38766 }
38770 {
38771 return;
38772 }
38774 {
38778 }
38779 }
38780 else if (this.ai[0] == 1
f)
38781 {
38782 this.ai[1]++;
38784 if (this.ai[1] >= 60
f)
38785 {
38790 {
38791 this.ai[3] = ((Main.player[
num314].Center.X >
base.Center.X) ? (-1
f) : 1
f);
38792 }
38793 else
38794 {
38796 }
38798 }
38799 }
38800 else if (this.ai[0] == 2
f)
38801 {
38803 this.ai[1]++;
38805 velocity.X =
Math.Min(
velocity.X +
this.ai[3] * 0.05f, 4
f);
38806 if ((
position.Y < (
float)(-
height) || this.ai[1] >= 180
f) && Main.netMode != 1)
38807 {
38808 Main.StartInvasion(4);
38811 }
38812 }
38815 if (this.ai[0] == 2
f)
38816 {
38819 }
38821 Lighting.AddLight(
base.Center,
rgb);
38822 }
38824 {
38825 if (Main.rand.Next(420) == 0)
38826 {
38828 }
38831 if (!Main.npc[(
int)this.ai[3]].active || Main.npc[(int)this.ai[3]].
type != 398)
38832 {
38836 }
38839 float num317 = this.ai[0];
38840 this.ai[1]++;
38844 {
38847 {
38848 break;
38849 }
38851 }
38853 {
38858 }
38861 if (this.ai[0] !=
num317)
38862 {
38864 }
38865 if (this.ai[0] == -1
f)
38866 {
38867 this.ai[1]++;
38868 if (this.ai[1] > 180
f)
38869 {
38871 }
38873 if (this.ai[1] < 60
f)
38874 {
38877 localAI[1] = (float)
Math.Sin(
this.ai[1] * ((
float)Math.PI * 2
f) / 15
f) * 0.35f;
38879 {
38881 }
38882 }
38883 else if (this.ai[1] < 120
f)
38884 {
38887 {
38889 }
38891 }
38892 else
38893 {
38897 {
38899 }
38900 }
38902 }
38903 if (this.ai[0] == 0
f)
38904 {
38906 Vector2
v2 = Main.player[
target].Center + Main.player[
target].velocity * 20
f -
base.Center;
38910 {
38912 }
38925 {
38927 {
38929 {
38931 }
38932 else
38933 {
38935 }
38937 {
38939 }
38940 else
38941 {
38943 }
38944 }
38945 }
38946 }
38947 else if (this.ai[0] == 1
f)
38948 {
38950 {
38953 }
38956 {
38958 }
38959 Vector2
v3 = Main.player[
target].Center + Main.player[
target].velocity * 20
f -
base.Center;
38963 {
38965 }
38967 {
38969 }
38970 else
38971 {
38973 }
38975 {
38977 }
38979 {
38983 }
38984 }
38985 else if (this.ai[0] == 2
f)
38986 {
38988 {
38991 {
38993 }
38997 {
38999 }
39000 }
39002 {
39007 {
39008 case 0:
39011 break;
39012 case 1:
39015 break;
39016 case 2:
39019 break;
39020 case 3:
39023 break;
39024 case 4:
39027 break;
39028 case 5:
39031 break;
39032 }
39035 val29 =
default(Vector2);
39038 val29 =
default(Vector2);
39045 {
39052 Main.dust[
num330].noGravity =
true;
39053 }
39054 if ((
num315 - 15
f) % 10
f == 0
f && Main.netMode != 1)
39055 {
39057 if (
vec3.HasNaNs())
39058 {
39059 vec3 = Vector2.UnitY * -1
f;
39060 }
39062 int num331 = Projectile.NewProjectile(
GetSpawnSource_ForProjectile(), base.Center.X +
vector151.X, base.Center.Y +
vector151.Y,
vec3.X,
vec3.Y, 454, 40, 0
f, Main.myPlayer, 30
f,
whoAmI);
39063 }
39064 }
39066 {
39067 localAI[0] =
localAI[0].AngleLerp(this.ai[2] - (
float)Math.PI / 2
f, 0.2f);
39070 {
39075 {
39078 {
39081 projectile13.velocity +=
velocity;
39082 projectile10.netUpdate = true;
39083 }
39084 }
39085 }
39086 velocity.Y *= 0.96f;
39087 this.ai[2] = (Main.player[
target].Center -
base.Center).ToRotation() + (float)
Math.PI / 2
f;
39089 }
39091 {
39094 {
39096 }
39097 Vector2
vector152 = (this.ai[2] - (float)
Math.PI / 2
f).ToRotationVector2() * 12
f;
39100 {
39103 {
39106 projectile12.netUpdate = true;
39107 }
39108 }
39109 }
39110 else
39111 {
39114 }
39115 }
39116 else if (this.ai[0] == 3
f)
39117 {
39119 {
39122 {
39124 }
39128 {
39130 }
39131 }
39133 {
39137 {
39139 }
39140 }
39142 {
39144 {
39145 this.ai[2] = (float)(Main.rand.Next(2) == 0).ToDirectionInt() * ((float)
Math.PI * 2
f) / 40
f;
39147 }
39149 {
39150 this.ai[2] *= 0.95f;
39151 }
39155 {
39157 }
39162 if ((
num315 - 15
f - 30
f) % 10
f == 0
f && Main.netMode != 1)
39163 {
39166 float ai3 = ((float)
Math.PI * 2
f * (
float)Main.rand.NextDouble() - (float)
Math.PI) / 30
f + (float)
Math.PI / 180
f *
this.ai[2];
39167 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector154.X,
vector154.Y,
vector155.X,
vector155.Y, 452, 35, 0
f, Main.myPlayer, 0
f,
ai3);
39168 }
39169 }
39170 else
39171 {
39176 {
39178 }
39180 }
39181 }
39182 else
39183 {
39184 if (this.ai[0] != 4
f)
39185 {
39186 return;
39187 }
39189 {
39192 }
39194 {
39198 {
39200 }
39203 {
39205 }
39207 {
39208 return;
39209 }
39213 {
39215 }
39217 {
39221 {
39224 }
39233 Main.dust[
num341].noGravity =
true;
39235 Main.dust[
num341].customData =
this;
39236 }
39237 }
39239 {
39240 if (
num315 == 180
f && Main.netMode != 1)
39241 {
39247 {
39249 }
39252 val29 =
default(Vector2);
39254 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
spinningpoint3.X,
spinningpoint3.Y, 455, 50, 0
f, Main.myPlayer,
num342 * ((float)
Math.PI * 2
f) / 540
f,
whoAmI);
39257 }
39260 {
39262 }
39263 float num343 = (this.ai[2] >= 0
f).ToDirectionInt();
39264 float num344 = this.ai[2];
39266 {
39268 }
39273 }
39274 else
39275 {
39278 {
39280 }
39281 }
39282 }
39283 }
39285 {
39290 int num348 = (int)this.ai[1];
39291 if (!Main.npc[
num346].active || Main.npc[
num346].type != 396)
39292 {
39296 return;
39297 }
39298 this.ai[2]++;
39299 if (this.ai[2] >=
num345)
39300 {
39301 if (Main.netMode != 1)
39302 {
39308 {
39310 {
39312 {
39314 }
39316 {
39318 }
39320 {
39321 break;
39322 }
39323 }
39324 }
39331 {
39334 {
39336 }
39343 }
39345 {
39348 {
39350 }
39357 }
39359 {
39362 {
39364 }
39371 }
39373 {
39376 {
39378 }
39385 }
39386 }
39390 }
39391 else
39392 {
39394 base.Center = Vector2.Lerp(Main.projectile[
num348].Center, Main.npc[(
int)
Math.Abs(
this.ai[0]) - 1].Center +
vector158,
this.ai[2] /
num345);
39397 {
39398 Vector2
val79 = base.Center - Vector2.One * 4
f;
39401 val29 =
default(Vector2);
39405 Main.dust[
num370].velocity = -Vector2.UnitY;
39406 Main.dust[
num370].noGravity =
true;
39407 Main.dust[
num370].scale = 0.7f;
39408 Main.dust[
num370].customData =
this;
39409 }
39412 {
39413 Vector2
val81 = base.Center - Vector2.One * 4
f;
39416 val29 =
default(Vector2);
39420 Main.dust[
num372].noGravity =
true;
39421 Main.dust[
num372].scale = 1.5f;
39422 Main.dust[
num372].customData =
this;
39423 }
39424 }
39425 }
39427 {
39429 {
39430 if (
localAI[3] == 0
f && Main.netMode != 1)
39431 {
39436 {
39440 return;
39441 }
39445 {
39451 {
39454 }
39455 else
39456 {
39459 }
39460 Main.npc[
num377].netUpdate =
true;
39461 }
39462 }
39463 if (
localAI[0] == 1
f && Main.netMode != 1)
39464 {
39467 {
39470 Main.npc[(int)this.ai[
num378] - 1].
ai[3] = 0
f;
39473 }
39474 }
39475 if (this.ai[0] != -1
f && Main.netMode != 1)
39476 {
39479 {
39481 {
39483 }
39484 if (Main.npc[(
int)this.ai[
num379] - 1].active && Main.npc[(int)this.ai[
num379] - 1].
type == 379)
39485 {
39487 }
39488 }
39490 {
39494 int num381 = (int)
base.Center.X / 16 + 11 * (Main.rand.Next(2) == 0).ToDirectionInt();
39497 {
39501 {
39503 break;
39504 }
39506 {
39508 }
39509 }
39515 }
39516 }
39517 if (this.ai[0] == -1
f)
39518 {
39519 this.ai[3]++;
39520 if (this.ai[3] > 300
f)
39521 {
39525 if (Main.netMode != 1)
39526 {
39528 {
39529 float num388 = 3
f + Main.rand.NextFloat() * 6
f;
39530 Vector2
vector159 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
39533 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
center21.X,
center21.Y,
vector159.X *
num388,
vector159.Y *
num388, 526, 0, 0
f, Main.myPlayer, Main.npc[(
int)
this.ai[2]].Center.X, Main.npc[(
int)
this.ai[2]].Center.Y);
39534 }
39536 {
39537 if (Main.rand.Next(2) != 0)
39538 {
39539 float num390 = 3
f + Main.rand.NextFloat() * 6
f;
39540 Vector2
vector160 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
39543 Vector2
vector161 = base.Center +
vector160 * (Main.rand.NextFloat() * 45
f + 45
f) + Vector2.UnitY * 20
f;
39544 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
center22.X,
center22.Y,
vector160.X *
num390, -20
f, 526, 0, 0
f, Main.myPlayer,
vector161.X,
vector161.Y);
39545 }
39546 }
39547 }
39548 }
39549 else if (this.ai[3] % 10
f == 1
f && this.ai[3] > 120
f && Main.netMode != 1)
39550 {
39551 float num392 = 3
f + Main.rand.NextFloat() * 6
f;
39552 Vector2
vector162 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
39555 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
center24.X,
center24.Y,
vector162.X *
num392,
vector162.Y *
num392, 526, 0, 0
f, Main.myPlayer, Main.npc[(
int)
this.ai[2]].Center.X, Main.npc[(
int)
this.ai[2]].Center.Y);
39556 }
39557 }
39558 }
39560 {
39561 velocity.X *= 0.93f;
39563 {
39565 }
39566 int num393 = (int)(0
f - this.ai[3] - 1
f);
39568 {
39572 return;
39573 }
39576 {
39580 }
39581 if (
justHit && Main.netMode != 1 && Main.npc[
num393].localAI[0] == 0
f)
39582 {
39583 Main.npc[
num393].localAI[0] = 1
f;
39584 }
39585 if ((this.ai[0] += 1
f) >= 300
f)
39586 {
39589 }
39590 }
39592 {
39593 Lighting.AddLight(
base.Center, 0.8f, 0.75f, 0.55f);
39594 }
39595 }
39597 {
39599 }
39601 {
39603 if (this.ai[0] == 0
f)
39604 {
39606 if (Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
39607 {
39609 }
39610 else
39611 {
39613 vector163.Y -= Main.player[
target].height / 4;
39616 {
39618 }
39619 else
39620 {
39622 center25.X = Main.player[
target].Center.X;
39625 {
39630 center26.Y = Main.player[
target].Center.Y;
39631 if (((Vector2)(
ref vector164)).Length() > 8
f && Collision.CanHit(
base.Center, 1, 1,
center26, 1, 1) && Collision.CanHit(
center26, 1, 1, Main.player[
target].position, 1, 1))
39632 {
39636 }
39637 }
39638 else
39639 {
39641 center25.Y = Main.player[
target].Center.Y;
39644 {
39648 }
39649 }
39650 if (this.ai[0] == 0
f)
39651 {
39658 }
39659 }
39660 }
39661 }
39662 else if (this.ai[0] == 1
f)
39663 {
39667 {
39669 }
39673 {
39675 }
39681 if (!Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
39682 {
39685 }
39687 {
39690 {
39693 {
39695 break;
39696 }
39697 }
39699 {
39700 base.Center = Main.player[
target].Top;
39705 }
39706 }
39707 }
39708 else if (this.ai[0] == 2
f)
39709 {
39716 {
39718 }
39724 {
39726 }
39727 }
39728 else if (this.ai[0] == 3
f)
39729 {
39737 {
39739 }
39745 {
39748 }
39750 {
39752 }
39753 }
39754 else if (this.ai[0] == 4
f)
39755 {
39758 {
39759 velocity.X *= -0.8f;
39760 }
39762 {
39763 velocity.Y *= -0.8f;
39764 }
39767 {
39769 vector170.Y -= Main.player[
target].height / 4;
39772 }
39775 {
39777 }
39784 if (this.ai[1] > 180
f)
39785 {
39788 }
39789 if (Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
39790 {
39792 }
39795 {
39798 center27.X = Main.player[
target].Center.X;
39799 if (Collision.CanHit(
base.Center, 1, 1,
center27, 1, 1) && Collision.CanHit(
base.Center, 1, 1,
center27, 1, 1) && Collision.CanHit(Main.player[
target].Center, 1, 1,
center27, 1, 1))
39800 {
39804 }
39805 else
39806 {
39808 center27.Y = Main.player[
target].Center.Y;
39809 if (Collision.CanHit(
base.Center, 1, 1,
center27, 1, 1) && Collision.CanHit(Main.player[
target].Center, 1, 1,
center27, 1, 1))
39810 {
39814 }
39815 }
39816 }
39817 }
39818 else if (this.ai[0] == 5
f)
39819 {
39822 {
39826 }
39827 else
39828 {
39832 if (!
player3.creativeGodMode)
39833 {
39835 }
39836 }
39837 }
39839 {
39842 {
39844 {
39846 {
39847 velocity.X -= 0.05f;
39848 }
39849 else
39850 {
39851 velocity.X += 0.05f;
39852 }
39854 {
39855 velocity.Y -= 0.05f;
39856 }
39857 else
39858 {
39859 velocity.Y += 0.05f;
39860 }
39861 }
39862 }
39863 }
39864 else
39865 {
39867 {
39868 return;
39869 }
39870 hide = this.ai[0] == 5
f;
39873 {
39875 {
39877 {
39878 velocity.X -= 0.05f;
39879 }
39880 else
39881 {
39882 velocity.X += 0.05f;
39883 }
39885 {
39886 velocity.Y -= 0.05f;
39887 }
39888 else
39889 {
39890 velocity.Y += 0.05f;
39891 }
39892 }
39893 }
39894 }
39895 }
39897 {
39899 {
39902 {
39904 }
39905 }
39910 {
39912 {
39913 continue;
39914 }
39917 {
39918 continue;
39919 }
39922 {
39924 {
39926 }
39927 else
39928 {
39930 }
39931 }
39937 }
39939 {
39942 {
39944 {
39948 {
39950 }
39951 else
39952 {
39954 }
39958 {
39961 ((Vector2)(
ref vector172)).
_002Ector((
float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
39963 vector172 *= (float)Main.rand.Next(0, 100) * 0.1f;
39966 vector172 *= (float)Main.rand.Next(50, 90) * 0.2f;
39971 Main.dust[
num415].alpha = 100;
39972 if (Main.rand.Next(2) == 0)
39973 {
39974 Main.dust[
num415].noGravity =
true;
39977 dust87.scale += 0.3f;
39978 }
39979 }
39981 }
39986 {
39987 if (Main.rand.Next(5) == 0)
39988 {
39995 Main.dust[
num419].alpha = 100;
39998 dust87.velocity *= 0.3f;
40001 dust87.velocity +=
velocity * 0.75f;
40002 Main.dust[
num419].noGravity =
true;
40004 }
40005 }
40006 }
40007 }
40009 {
40012 {
40014 {
40018 {
40020 }
40021 else
40022 {
40024 }
40025 }
40029 {
40036 Main.dust[
num423].noGravity =
true;
40037 Main.dust[
num423].noLight =
true;
40039 }
40040 }
40041 }
40042 if (this.ai[0] == 0
f)
40043 {
40047 }
40048 else if (this.ai[0] == 1
f)
40049 {
40057 {
40063 }
40064 velocity.X += this.ai[1] *
num425;
40066 {
40068 }
40070 {
40072 }
40075 {
40077 }
40079 {
40081 }
40083 {
40085 }
40087 if ((this.ai[1] > 0
f && Main.player[
target].Center.X -
base.Center.X < 0
f -
num428) || (this.ai[1] < 0
f && Main.player[
target].Center.X - base.Center.X >
num428))
40088 {
40091 if (
base.Center.Y + 20
f > Main.player[
target].Center.Y)
40092 {
40094 }
40095 else
40096 {
40098 }
40099 }
40100 }
40101 else if (this.ai[0] == 2
f)
40102 {
40107 {
40111 }
40112 velocity.Y += this.ai[1] *
num431;
40114 {
40116 }
40118 {
40122 }
40123 }
40124 else if (this.ai[0] == 3
f)
40125 {
40131 {
40136 }
40137 velocity.X += this.ai[1] *
num434;
40138 if (
base.Center.Y > Main.player[
target].Center.Y)
40139 {
40141 }
40142 else
40143 {
40145 }
40147 {
40149 }
40151 {
40155 }
40156 }
40158 {
40162 {
40168 Main.dust[
num441].noGravity =
true;
40169 Main.dust[
num441].noLight =
true;
40170 }
40172 }
40173 }
40175 {
40176 knockBackResist = 0.2f * Main.GameModeInfo.KnockbackToEnemiesMultiplier;
40181 if (this.ai[0] != 7
f && Main.player[
target].dead)
40182 {
40184 if (Main.player[
target].dead)
40185 {
40191 }
40192 }
40193 if (this.ai[0] == 0
f)
40194 {
40198 {
40202 }
40203 }
40204 else if (this.ai[0] == 1
f)
40205 {
40207 if (Main.netMode != 1 &&
this.ai[1] > 36
f)
40208 {
40212 }
40213 }
40214 else if (this.ai[0] == 2
f)
40215 {
40217 if (Main.netMode != 1 && ((Vector2)(
ref vector174)).Length() > 600
f)
40218 {
40224 }
40226 {
40228 velocity.X *= 0.85f;
40233 if (!Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
40234 {
40236 }
40237 if (Main.netMode != 1 &&
this.ai[1] >
num442)
40238 {
40240 if (this.ai[3] >= 3
f)
40241 {
40245 }
40250 }
40251 }
40252 else
40253 {
40255 velocity.X *= 0.99f;
40257 {
40259 }
40261 {
40263 }
40264 }
40266 if ((
double)this.ai[2] > 210.0 && velocity.Y == 0
f && Main.netMode != 1)
40267 {
40268 switch (Main.rand.Next(3))
40269 {
40270 case 0:
40272 break;
40273 case 1:
40277 break;
40278 case 2:
40280 break;
40281 default:
40283 break;
40284 }
40285 if (Main.tenthAnniversaryWorld &&
type == 476 &&
this.ai[0] == 3
f && Main.rand.Next(2) == 0)
40286 {
40288 }
40293 }
40294 }
40295 else if (this.ai[0] == 3
f)
40296 {
40297 velocity.X *= 0.85f;
40300 if (Main.netMode != 1 &&
this.ai[1] >= 180
f)
40301 {
40305 }
40306 if (Main.expertMode)
40307 {
40310 }
40311 }
40312 else if (this.ai[0] == 4
f)
40313 {
40318 {
40320 }
40321 else
40322 {
40324 }
40328 center29.Y -= 350
f;
40330 if (this.ai[2] == 1
f)
40331 {
40337 if (Main.netMode != 1 &&
this.ai[1] > 6
f)
40338 {
40340 this.ai[0] = 4.1f;
40344 }
40345 }
40346 else if (
Math.Abs(
base.Center.X - Main.player[
target].Center.X) < 40
f && base.Center.Y < Main.player[
target].Center.Y - 300
f)
40347 {
40348 if (Main.netMode != 1)
40349 {
40353 }
40354 }
40355 else
40356 {
40360 }
40361 }
40362 else if (this.ai[0] == 4.1
f)
40363 {
40365 if (this.ai[2] == 0
f && Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1) && !Collision.SolidCollision(
position,
width,
height))
40366 {
40368 }
40370 {
40372 if (Main.netMode != 1 &&
this.ai[1] > 10
f)
40373 {
40380 {
40382 }
40383 }
40384 }
40385 else if (this.ai[2] == 0
f)
40386 {
40390 }
40391 velocity.Y += 0.2f;
40393 {
40395 }
40396 }
40397 else if (this.ai[0] == 5
f)
40398 {
40400 {
40402 }
40403 else
40404 {
40406 }
40414 {
40420 }
40422 {
40425 }
40427 }
40428 else if (this.ai[0] == 6
f)
40429 {
40432 {
40434 velocity.X *= 0.8f;
40436 if (this.ai[1] > 5
f)
40437 {
40440 if (Main.player[
target].position.Y + (
float)Main.player[
target].height <
base.Center.Y)
40441 {
40442 velocity.Y -= 1.25f;
40443 }
40444 if (Main.player[
target].position.Y + (
float)Main.player[
target].height <
base.Center.Y - 40
f)
40445 {
40446 velocity.Y -= 1.5f;
40447 }
40448 if (Main.player[
target].position.Y + (
float)Main.player[
target].height <
base.Center.Y - 80
f)
40449 {
40450 velocity.Y -= 1.75f;
40451 }
40452 if (Main.player[
target].position.Y + (
float)Main.player[
target].height <
base.Center.Y - 120
f)
40453 {
40455 }
40456 if (Main.player[
target].position.Y + (
float)Main.player[
target].height <
base.Center.Y - 160
f)
40457 {
40458 velocity.Y -= 2.25f;
40459 }
40460 if (Main.player[
target].position.Y + (
float)Main.player[
target].height <
base.Center.Y - 200
f)
40461 {
40462 velocity.Y -= 2.5f;
40463 }
40464 if (!Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
40465 {
40467 }
40471 }
40472 }
40473 else
40474 {
40475 velocity.X *= 0.98f;
40477 {
40479 }
40481 {
40483 }
40484 }
40485 if (Main.netMode != 1 &&
this.ai[2] >= 3
f &&
velocity.Y == 0
f)
40486 {
40492 }
40493 }
40494 else if (this.ai[0] == 7
f)
40495 {
40502 {
40504 }
40505 velocity.X *= 0.98f;
40506 }
40507 else
40508 {
40509 if (this.ai[0] != 8
f)
40510 {
40511 return;
40512 }
40513 velocity.X *= 0.85f;
40515 if (Main.netMode != 1)
40516 {
40517 if (!Main.tenthAnniversaryWorld ||
this.ai[1] >= 180
f)
40518 {
40522 }
40523 else if (this.ai[1] % 20
f == 0
f)
40524 {
40526 }
40527 }
40528 }
40529 }
40531 {
40535 knockBackResist = 0.2f * Main.GameModeInfo.KnockbackToEnemiesMultiplier;
40537 if (!Main.eclipse && Main.netMode != 1)
40538 {
40539 if (this.ai[0] != -1
f)
40540 {
40542 }
40544 }
40546 {
40549 if (Main.netMode != 1 && (Main.player[
target].dead || ((Vector2)(
ref vector177)).Length() > 3000
f))
40550 {
40551 if (this.ai[0] != -1
f)
40552 {
40554 }
40556 }
40557 }
40558 else
40559 {
40561 if (Main.netMode != 1 &&
this.ai[0] > 1
f && ((Vector2)(
ref vector178)).Length() > 1000
f)
40562 {
40563 if (this.ai[0] != 1
f)
40564 {
40566 }
40568 }
40569 }
40570 if (this.ai[0] == -1
f)
40571 {
40577 }
40578 else if (this.ai[0] == 0
f)
40579 {
40581 if (
base.Center.X < Main.player[
target].Center.X - 2
f)
40582 {
40584 }
40585 if (
base.Center.X > Main.player[
target].Center.X + 2
f)
40586 {
40588 }
40592 {
40595 {
40597 }
40599 {
40601 }
40602 }
40604 {
40607 {
40609 }
40611 {
40613 }
40614 }
40616 vector181.Y -= 200
f;
40618 {
40624 }
40626 {
40632 }
40634 {
40636 }
40638 {
40640 }
40641 if (Main.netMode == 1)
40642 {
40643 return;
40644 }
40647 {
40648 this.ai[1] += Main.rand.Next(10, 30);
40649 }
40650 if (!(this.ai[1] >= 180
f))
40651 {
40652 return;
40653 }
40658 while (this.ai[0] == 0
f)
40659 {
40660 int num450 = Main.rand.Next(3);
40661 if (
num450 == 0 && Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
40662 {
40664 continue;
40665 }
40667 {
40668 case 1:
40670 break;
40671 case 2:
40673 {
40675 }
40676 break;
40677 }
40678 }
40679 }
40680 else if (this.ai[0] == 1
f)
40681 {
40687 {
40689 }
40691 {
40693 }
40695 {
40697 }
40702 {
40708 }
40714 }
40715 else if (this.ai[0] == 2
f)
40716 {
40720 {
40727 }
40728 if (Main.player[
target].Center.X - 10
f <
base.Center.X)
40729 {
40731 }
40732 else if (Main.player[
target].Center.X + 10
f >
base.Center.X)
40733 {
40735 }
40739 {
40742 {
40744 }
40746 {
40748 }
40749 }
40751 {
40754 {
40756 }
40758 {
40760 }
40761 }
40763 vector183.Y -= 20
f;
40764 this.ai[2] += 1
f / 45
f;
40765 if (Main.expertMode)
40766 {
40767 this.ai[2] += 1
f / 60
f;
40768 }
40774 if (Main.netMode != 1)
40775 {
40777 if (this.ai[1] > 240
f || !Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
40778 {
40784 }
40785 }
40786 }
40787 else if (this.ai[0] == 3
f)
40788 {
40792 {
40794 }
40795 else
40796 {
40798 }
40802 vector184.Y -= 12
f;
40803 if (
base.Center.X > Main.player[
target].Center.X)
40804 {
40805 vector184.X += 400
f;
40806 }
40807 else
40808 {
40809 vector184.X -= 400
f;
40810 }
40811 if (Main.netMode != 1 &&
Math.Abs(
base.Center.X - Main.player[
target].Center.X) > 350
f &&
Math.Abs(
base.Center.Y - Main.player[
target].Center.Y) < 20
f)
40812 {
40813 this.ai[0] = 3.1f;
40816 }
40817 this.ai[1] += 1
f / 30
f;
40818 float num455 = 8
f + this.ai[1];
40823 }
40824 else if (this.ai[0] == 3.1
f)
40825 {
40830 vector185.Y -= 12
f;
40837 {
40839 }
40840 else
40841 {
40843 }
40846 if (Main.netMode != 1 &&
this.ai[1] > 10
f)
40847 {
40850 {
40852 }
40853 else
40854 {
40856 }
40857 this.ai[0] = 3.2f;
40861 }
40862 }
40863 else if (this.ai[0] == 3.2
f)
40864 {
40870 this.ai[2] += 1
f / 30
f;
40871 velocity.X = (16
f + this.ai[2]) * this.ai[1];
40872 if ((this.ai[1] > 0
f &&
base.Center.X > Main.player[
target].Center.X + 260
f) || (this.ai[1] < 0
f && base.Center.X < Main.player[
target].Center.X - 260
f))
40873 {
40875 {
40881 }
40882 else if (Main.netMode != 1 &&
Math.Abs(
base.Center.X - Main.player[
target].Center.X) > 800
f)
40883 {
40889 }
40890 }
40892 }
40893 else if (this.ai[0] == 4
f)
40894 {
40895 bool flag95 = (double)(
base.Center.Y / 16
f) < Main.worldSurface;
40897 if (Main.netMode != 1)
40898 {
40903 {
40911 {
40912 continue;
40913 }
40917 {
40920 {
40922 break;
40923 }
40926 {
40928 break;
40929 }
40931 {
40933 break;
40934 }
40937 {
40939 break;
40940 }
40942 {
40944 break;
40945 }
40947 {
40948 break;
40949 }
40951 }
40953 {
40955 if (((Vector2)(
ref val29)).Length() < 600
f)
40956 {
40957 this.ai[0] = 4.1f;
40960 break;
40961 }
40962 }
40963 }
40964 }
40966 }
40967 else if (this.ai[0] == 4.1
f)
40968 {
40970 {
40972 }
40974 {
40976 }
40980 int num466 = (int)this.ai[1];
40981 int num467 = (int)this.ai[2];
40984 Vector2
v4 =
default(Vector2);
40989 {
40991 }
40993 if (((Vector2)(
ref v4)).Length() < 10
f)
40994 {
40995 this.ai[0] = 4.2f;
40997 }
40998 v4 =
v4.SafeNormalize(Vector2.Zero);
41002 {
41005 }
41006 }
41007 else
41008 {
41009 if (this.ai[0] != 4.2
f)
41010 {
41011 return;
41012 }
41016 int num471 = (int)this.ai[1];
41017 int num472 = (int)this.ai[2];
41025 if (Main.netMode != 1 && ((Vector2)(
ref vector186)).Length() < 4
f)
41026 {
41028 if (Main.expertMode)
41029 {
41031 }
41033 if (this.ai[3] == (
float)
num475)
41034 {
41036 Main.npc[
num476].netUpdate =
true;
41037 }
41038 else if (this.ai[3] == (
float)(
num475 * 2))
41039 {
41046 {
41048 }
41050 {
41052 }
41053 }
41054 }
41056 {
41059 }
41062 {
41065 }
41066 }
41067 }
41069 {
41071 {
41072 velocity.X *= 0.9f;
41074 }
41075 else
41076 {
41077 velocity.X *= 0.99f;
41079 }
41081 if (Main.expertMode)
41082 {
41084 }
41086 {
41087 this.ai[0] -= Main.rand.Next(10, 21);
41088 if (!Main.expertMode)
41089 {
41090 this.ai[0] -= Main.rand.Next(10, 21);
41091 }
41092 }
41094 if (this.ai[0] >= (
float)
num477)
41095 {
41097 }
41099 {
41102 if ((
float)Main.rand.Next(-10, 120) <
num478 * 100
f)
41103 {
41104 velocity.Y -= (float)Main.rand.Next(20, 40) * 0.025f;
41105 velocity.X += (float)Main.rand.Next(-20, 20) * 0.025f;
41108 }
41109 }
41110 }
41112 {
41114 knockBackResist = 0.4f * Main.GameModeInfo.KnockbackToEnemiesMultiplier;
41117 if (!Main.eclipse)
41118 {
41120 velocity.Y -= 0.2f;
41122 {
41124 }
41126 return;
41127 }
41128 if (this.ai[0] == 0
f || this.ai[0] == 1
f)
41129 {
41131 {
41133 {
41136 {
41143 }
41144 }
41145 }
41146 }
41148 {
41152 {
41154 }
41155 }
41156 else
41157 {
41159 if (this.ai[0] > 1
f && ((Vector2)(
ref vector189)).Length() > 1000
f)
41160 {
41162 }
41163 }
41164 if (this.ai[0] == -1
f)
41165 {
41171 }
41172 else if (this.ai[0] == 0
f)
41173 {
41177 {
41180 {
41182 }
41184 {
41186 }
41187 }
41189 {
41192 {
41194 }
41196 {
41198 }
41199 }
41202 {
41207 }
41209 {
41215 }
41217 {
41219 }
41221 {
41223 }
41225 if (this.ai[1] >= 90
f)
41226 {
41229 }
41230 }
41231 else if (this.ai[0] == 1
f)
41232 {
41238 {
41240 }
41242 {
41244 }
41246 {
41248 }
41253 {
41258 }
41259 this.ai[2] += 1
f / 60
f;
41265 }
41266 else if (this.ai[0] == 2
f)
41267 {
41269 {
41271 }
41273 {
41275 }
41288 {
41290 }
41291 else
41292 {
41294 }
41297 if (this.ai[1] > 10
f)
41298 {
41301 {
41303 }
41304 else
41305 {
41307 }
41308 this.ai[0] = 2.1f;
41310 }
41311 }
41312 else
41313 {
41314 if (this.ai[0] != 2.1
f)
41315 {
41316 return;
41317 }
41319 {
41321 }
41323 {
41325 }
41332 if (this.ai[1] > (
float)
num487)
41333 {
41335 {
41339 }
41340 else if (this.ai[1] > (
float)(
num487 * 2))
41341 {
41345 }
41346 }
41347 }
41348 }
41350 {
41354 if (
justHit && Main.netMode != 1 && Main.expertMode && Main.rand.Next(6) == 0)
41355 {
41359 }
41360 if (this.ai[0] == -1
f)
41361 {
41364 velocity.X *= 0.98f;
41366 if (this.ai[1] >= 120
f)
41367 {
41368 this.ai[0] = (this.ai[1] = (this.ai[2] = (this.ai[3] = 0
f)));
41369 }
41370 }
41371 else if (this.ai[0] == 0
f)
41372 {
41374 if (Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
41375 {
41377 return;
41378 }
41380 vector195.Y -= Main.player[
target].height / 4;
41383 center30.X = Main.player[
target].Center.X;
41386 {
41391 center31.Y = Main.player[
target].Center.Y;
41392 if (((Vector2)(
ref vector196)).Length() > 8
f && Collision.CanHit(
base.Center, 1, 1,
center31, 1, 1) && Collision.CanHit(
center31, 1, 1, Main.player[
target].position, 1, 1))
41393 {
41397 }
41398 }
41399 else
41400 {
41402 center30.Y = Main.player[
target].Center.Y;
41405 {
41409 }
41410 }
41411 if (this.ai[0] == 0
f)
41412 {
41419 }
41420 }
41421 else if (this.ai[0] == 1
f)
41422 {
41431 if (!Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
41432 {
41435 }
41436 }
41437 else if (this.ai[0] == 2
f)
41438 {
41448 {
41450 }
41451 }
41452 else if (this.ai[0] == 3
f)
41453 {
41464 {
41467 }
41469 {
41471 }
41472 }
41473 else
41474 {
41475 if (this.ai[0] != 4
f)
41476 {
41477 return;
41478 }
41480 {
41481 velocity.X *= -0.8f;
41482 }
41484 {
41485 velocity.Y *= -0.8f;
41486 }
41489 {
41491 vector202.Y -= Main.player[
target].height / 4;
41494 }
41502 if (this.ai[1] > 180
f)
41503 {
41506 }
41507 if (Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
41508 {
41510 }
41513 {
41514 return;
41515 }
41518 center32.X = Main.player[
target].Center.X;
41519 if (Collision.CanHit(
base.Center, 1, 1,
center32, 1, 1) && Collision.CanHit(
base.Center, 1, 1,
center32, 1, 1) && Collision.CanHit(Main.player[
target].Center, 1, 1,
center32, 1, 1))
41520 {
41524 return;
41525 }
41527 center32.Y = Main.player[
target].Center.Y;
41528 if (Collision.CanHit(
base.Center, 1, 1,
center32, 1, 1) && Collision.CanHit(Main.player[
target].Center, 1, 1,
center32, 1, 1))
41529 {
41533 }
41534 }
41535 }
41537 {
41538 if (Main.rand.Next(20) == 0)
41539 {
41540 switch (Main.rand.Next(15, 18))
41541 {
41542 case 15:
41544 break;
41545 case 16:
41547 break;
41548 case 17:
41550 break;
41551 }
41552 }
41553 if (Main.netMode == 1)
41554 {
41555 return;
41556 }
41558 int num501 = (int)this.ai[0];
41559 int num503 = (int)this.ai[1];
41561 {
41563 }
41565 {
41567 if (
target == 255 || Main.player[
target].dead || Vector2.Distance(
base.Center, Main.player[
target].Center) > 160000
f)
41568 {
41570 }
41571 }
41573 {
41579 {
41581 }
41582 }
41583 }
41585 {
41586 if (Main.netMode != 1 &&
localAI[0] == 0
f)
41587 {
41590 {
41593 Main.npc[
num506].timeLeft = 600;
41594 Main.npc[
num506].netUpdate =
true;
41596 }
41598 }
41601 {
41602 if (this.ai[
num507] >= 0
f && (!Main.npc[(
int)
this.ai[
num507]].active || Main.npc[(
int)
this.ai[
num507]].type != 492))
41603 {
41606 }
41607 else if (this.ai[
num507] >= 0
f)
41608 {
41610 }
41611 }
41613 {
41615 return;
41616 }
41617 if (Main.netMode != 1 && Main.rand.Next(300) == 0)
41618 {
41619 Vector2
spinningpoint36 =
new Vector2((Main.rand.NextFloat() - 0.5f) * (
float)(
width - 70), (Main.rand.NextFloat() - 0.5f) * 20
f - (
float)(
height / 2) - 20
f);
41621 val29 =
default(Vector2);
41625 Main.npc[
num508].velocity =
new Vector2((Main.rand.NextFloat() - 0.5f) * 5
f, -8.01f) +
velocity;
41626 Main.npc[
num508].netUpdate =
true;
41627 Main.npc[
num508].timeLeft = 600;
41628 }
41630 {
41632 }
41638 {
41640 }
41641 else
41642 {
41644 {
41647 {
41649 break;
41650 }
41651 }
41652 }
41655 {
41658 {
41660 }
41662 }
41664 {
41667 {
41669 }
41671 }
41672 else
41673 {
41674 velocity.Y *= 0.95f;
41675 }
41678 {
41680 }
41684 {
41685 if (Main.rand.Next(2) != 0)
41686 {
41687 Vector2
spinningpoint37 =
new Vector2((Main.rand.NextFloat() - 0.5f) * (
float)(
width - 70), (Main.rand.NextFloat() - 0.5f) * 20
f + (
float)(
height / 2) + 10
f);
41689 val29 =
default(Vector2);
41691 Dust[]
dust90 = Main.dust;
41695 dust85.position = base.Center +
vector204;
41696 dust85.velocity = Vector2.Zero;
41697 dust85.noGravity = true;
41698 dust85.noLight = true;
41699 dust85.fadeIn = 1.5f;
41700 dust85.scale = 0.5f;
41701 }
41702 }
41703 }
41705 {
41706 if (this.ai[2] == 1
f)
41707 {
41710 {
41711 velocity.Y += 0.02f;
41712 }
41714 {
41715 velocity.Y -= 0.02f;
41716 }
41718 this.ai[1]++;
41719 if (this.ai[1] > 120
f)
41720 {
41722 }
41725 {
41726 case 517:
41728 break;
41729 case 422:
41731 break;
41732 case 507:
41734 break;
41735 case 493:
41737 break;
41738 }
41739 if (Main.rand.Next(5) == 0 && this.ai[1] < 120
f)
41740 {
41742 {
41743 Dust[]
dust91 = Main.dust;
41744 Vector2 left =
base.Left;
41750 dust86.position = base.Center + Vector2.UnitY.RotatedByRandom(4.188790321350098) *
new Vector2((
float)
width * 1.5
f, (
float)
height * 1.1
f) * 0.8f * (0.8f + Main.rand.NextFloat() * 0.2f);
41751 dust86.velocity.X = 0
f;
41752 dust86.velocity.Y = (0
f -
Math.Abs(
dust86.velocity.Y - (
float)
num520 + velocity.Y - 4
f)) * 3
f;
41753 dust86.noGravity = true;
41754 dust86.fadeIn = 1
f;
41755 dust86.scale = 1
f + Main.rand.NextFloat() + (float)
num520 * 0.3
f;
41756 }
41757 }
41758 if (this.ai[1] < 150
f)
41759 {
41761 {
41762 if (Main.rand.Next(4) == 0)
41763 {
41764 Dust[]
dust92 = Main.dust;
41765 Vector2
val87 = base.Top +
new Vector2((
float)(-
width) * (0.33
f - 0.11
f * (
float)
num521), -20
f);
41770 dust60.velocity.X = 0
f;
41771 dust60.velocity.Y = (0
f -
Math.Abs(
dust60.velocity.Y - (
float)
num521 + velocity.Y - 4
f)) * (1
f + this.ai[1] / 180
f * 0.5f);
41772 dust60.noGravity = true;
41773 dust60.fadeIn = 1
f;
41774 dust60.scale = 1
f + Main.rand.NextFloat() + (float)
num521 * 0.3
f;
41775 }
41776 }
41777 }
41778 if (Main.rand.Next(5) == 0 && this.ai[1] < 150
f)
41779 {
41781 {
41782 Vector2
vector205 = base.Center + Vector2.UnitY.RotatedByRandom(4.188790321350098) *
new Vector2((
float)
width, (
float)
height) * 0.7f * Main.rand.NextFloat();
41783 float num523 = 1
f + Main.rand.NextFloat() * 2
f + this.ai[1] / 180
f * 4
f;
41785 {
41786 Dust[]
dust93 = Main.dust;
41791 dust61.velocity.X *=
num523;
41793 dust61.noGravity = true;
41794 dust61.fadeIn = 1
f;
41795 dust61.scale = 1.5f + Main.rand.NextFloat() + (float)
num525 * 0.13
f;
41796 }
41798 }
41799 }
41800 if (Main.rand.Next(3) != 0 && this.ai[1] < 150
f)
41801 {
41802 Dust[]
dust94 = Main.dust;
41808 dust62.position = base.Center + Vector2.UnitY.RotatedByRandom(4.188790321350098) *
new Vector2((
float)(
width / 2), (
float)(
height / 2)) * (0.8f + Main.rand.NextFloat() * 0.2f);
41809 dust62.velocity.X = 0
f;
41810 dust62.velocity.Y =
Math.Abs(
dust62.velocity.Y) * 0.25f;
41811 }
41812 if (this.ai[1] % 60
f == 1
f)
41813 {
41815 }
41816 if (this.ai[1] >= 180
f)
41817 {
41821 }
41822 return;
41823 }
41824 if (this.ai[3] > 0
f)
41825 {
41828 {
41829 case 517:
41831 break;
41832 case 422:
41834 break;
41835 case 507:
41837 break;
41838 case 493:
41840 break;
41841 }
41843 {
41845 }
41846 else if (this.ai[3] == 1
f)
41847 {
41849 }
41850 this.ai[3]++;
41851 if (this.ai[3] > 120
f)
41852 {
41854 }
41855 }
41857 {
41858 case 517:
41860 break;
41861 case 422:
41863 break;
41864 case 507:
41866 break;
41867 case 493:
41869 break;
41870 }
41872 if (Main.player[
target].Distance(
base.Center) > 2000
f)
41873 {
41875 }
41876 if (
localAI[0] >= 60
f && Main.netMode != 1)
41877 {
41881 }
41882 else
41883 {
41885 }
41886 velocity =
new Vector2(0
f, (
float)
Math.Sin((
float)
Math.PI * 2
f *
this.ai[0] / 300
f) * 0.5f);
41887 Point origin =
base.Bottom.ToTileCoordinates();
41891 if (
WorldGen.InWorld(origin.X, origin.Y, 20) && Main.tile[origin.X, origin.Y] !=
null)
41892 {
41894 {
41896 position.Y -= 1.5f *
num528;
41897 }
41899 {
41902 {
41904 }
41905 position.Y += 1.5f *
num529;
41906 }
41907 }
41908 if (!Main.remixWorld && !Main.getGoodWorld && (double)base.Bottom.Y > Main.worldSurface * 16.0 - 100.0)
41909 {
41910 position.Y = (float)Main.worldSurface * 16
f - (
float)
height - 100
f;
41911 }
41912 this.ai[0]++;
41913 if (this.ai[0] >= 300
f)
41914 {
41917 }
41919 {
41920 if (Main.rand.Next(5) == 0)
41921 {
41922 Dust[]
dust95 = Main.dust;
41928 dust63.position = base.Center + Vector2.UnitY.RotatedByRandom(2.094395160675049) *
new Vector2((
float)(
width / 2), (
float)(
height / 2)) * (0.8f + Main.rand.NextFloat() * 0.2f);
41929 dust63.velocity.X = 0
f;
41930 dust63.velocity.Y =
Math.Abs(
dust63.velocity.Y) * 0.25f;
41931 }
41933 {
41934 if (Main.rand.Next(5) == 0)
41935 {
41936 Dust[]
dust96 = Main.dust;
41937 Vector2
val88 = base.Top +
new Vector2((
float)(-
width) * (0.33
f - 0.11
f * (
float)
num530), -20
f);
41941 dust64.velocity.X = 0
f;
41942 dust64.velocity.Y = (0
f -
Math.Abs(
dust64.velocity.Y - (
float)
num530 + velocity.Y - 4
f)) * 1
f;
41943 dust64.noGravity = true;
41944 dust64.fadeIn = 1
f;
41945 dust64.scale = 1
f + Main.rand.NextFloat() + (float)
num530 * 0.3
f;
41946 }
41947 }
41948 if (this.ai[1] > 0
f)
41949 {
41950 this.ai[1]--;
41951 }
41952 if (Main.netMode != 1 &&
this.ai[1] <= 0
f && Main.player[
target].active && !Main.player[
target].dead &&
Distance(Main.player[
target].Center) < 1080
f && Main.player[
target].position.Y - position.Y < 400
f)
41953 {
41955 }
41956 }
41958 {
41959 if (Main.rand.Next(5) == 0)
41960 {
41961 Dust[]
dust97 = Main.dust;
41967 dust65.position = base.Center + Vector2.UnitY.RotatedByRandom(2.094395160675049) *
new Vector2((
float)(
width / 2), (
float)(
height / 2)) * (0.8f + Main.rand.NextFloat() * 0.2f);
41968 dust65.velocity.X = 0
f;
41969 dust65.velocity.Y =
Math.Abs(
dust65.velocity.Y) * 0.25f;
41970 }
41972 {
41973 if (Main.rand.Next(5) == 0)
41974 {
41975 Dust[]
dust98 = Main.dust;
41976 Vector2
val89 = base.Top +
new Vector2((
float)(-
width) * (0.33
f - 0.11
f * (
float)
num531), -20
f);
41980 dust66.velocity.X = 0
f;
41981 dust66.velocity.Y = (0
f -
Math.Abs(
dust66.velocity.Y - (
float)
num531 + velocity.Y - 4
f)) * 1
f;
41982 dust66.noGravity = true;
41983 dust66.fadeIn = 1
f;
41984 dust66.color = Color.Black;
41985 dust66.scale = 1
f + Main.rand.NextFloat() + (float)
num531 * 0.3
f;
41986 }
41987 }
41988 }
41990 {
41991 if (Main.rand.Next(5) == 0)
41992 {
41993 Dust[]
dust99 = Main.dust;
41999 dust67.position = base.Center + Vector2.UnitY.RotatedByRandom(2.094395160675049) *
new Vector2((
float)(
width / 2), (
float)(
height / 2)) * (0.8f + Main.rand.NextFloat() * 0.2f);
42000 dust67.velocity.X = 0
f;
42001 dust67.velocity.Y =
Math.Abs(
dust67.velocity.Y) * 0.25f;
42002 }
42004 {
42005 if (Main.rand.Next(5) == 0)
42006 {
42008 Vector2
val90 = base.Top +
new Vector2((
float)(-
width) * (0.33
f - 0.11
f * (
float)
num532), -20
f);
42012 dust68.velocity.X = 0
f;
42013 dust68.velocity.Y = (0
f -
Math.Abs(
dust68.velocity.Y - (
float)
num532 + velocity.Y - 4
f)) * 1
f;
42014 dust68.noGravity = true;
42015 dust68.fadeIn = 1
f;
42016 dust68.color = Color.Black;
42017 dust68.scale = 1
f + Main.rand.NextFloat() + (float)
num532 * 0.3
f;
42018 }
42019 }
42020 if (this.ai[1] > 0
f)
42021 {
42022 this.ai[1]--;
42023 }
42024 if (Main.netMode != 1 &&
this.ai[1] <= 0
f && Main.player[
target].active && !Main.player[
target].dead &&
Distance(Main.player[
target].Center) < 3240
f && !Collision.CanHitLine(
base.Center, 0, 0, Main.player[
target].Center, 0, 0))
42025 {
42026 this.ai[1] = 60 + Main.rand.Next(120);
42027 Point
point3 = Main.player[
target].Top.ToTileCoordinates();
42030 {
42032 {
42033 break;
42034 }
42036 {
42037 break;
42038 }
42040 }
42042 {
42044 }
42045 else
42046 {
42048 }
42049 }
42051 {
42052 this.ai[1] = 420 + Main.rand.Next(360);
42053 Point
point4 =
base.Center.ToTileCoordinates();
42054 Point
point5 = Main.player[
target].Center.ToTileCoordinates();
42063 {
42065 }
42067 {
42072 {
42075 {
42077 }
42079 {
42081 }
42082 if (
flag103 && !Collision.CanHitLine(
base.Center, 0, 0, Main.player[
target].Center, 0, 0))
42083 {
42085 }
42087 {
42090 break;
42091 }
42092 }
42093 }
42094 }
42095 }
42097 {
42098 return;
42099 }
42100 if (Main.rand.Next(5) == 0)
42101 {
42108 dust69.position = base.Center + Vector2.UnitY.RotatedByRandom(2.094395160675049) *
new Vector2((
float)(
width / 2), (
float)(
height / 2)) * (0.8f + Main.rand.NextFloat() * 0.2f);
42109 dust69.velocity.X = 0
f;
42110 dust69.velocity.Y =
Math.Abs(
dust69.velocity.Y) * 0.25f;
42111 }
42113 {
42114 if (Main.rand.Next(5) == 0)
42115 {
42117 Vector2
val91 = base.Top +
new Vector2((
float)(-
width) * (0.33
f - 0.11
f * (
float)
num542), -20
f);
42121 dust71.velocity.X = 0
f;
42122 dust71.velocity.Y = (0
f -
Math.Abs(
dust71.velocity.Y - (
float)
num542 + velocity.Y - 4
f)) * 1
f;
42123 dust71.noGravity = true;
42124 dust71.fadeIn = 1
f;
42125 dust71.scale = 1
f + Main.rand.NextFloat() + (float)
num542 * 0.3
f;
42126 }
42127 }
42128 if (this.ai[1] > 0
f)
42129 {
42130 this.ai[1]--;
42131 }
42132 if (Main.netMode != 1 &&
this.ai[1] <= 0
f && Main.player[
target].active && !Main.player[
target].dead &&
Distance(Main.player[
target].Center) < 1080
f && Main.player[
target].position.Y - position.Y < 700
f)
42133 {
42134 Vector2
vector207 = base.Top +
new Vector2((
float)(-
width) * 0.33
f, -20
f) +
new Vector2((
float)
width * 0.66
f, 20
f) * Utils.RandomVector2(Main.rand, 0
f, 1
f);
42135 Vector2
vector208 = -Vector2.UnitY.RotatedByRandom(0.7853981852531433) * (7
f + Main.rand.NextFloat() * 5
f);
42138 Main.npc[
num543].netUpdate =
true;
42140 }
42141 }
42143 {
42146 {
42148 }
42150 this.ai[0]++;
42153 if (this.ai[0] >=
num544)
42154 {
42155 if (Main.netMode != 1)
42156 {
42159 }
42160 return;
42161 }
42163 if (!(this.ai[0] > 20
f))
42164 {
42165 return;
42166 }
42170 {
42171 if (Main.rand.Next(2) != 0)
42172 {
42176 {
42179 }
42189 dust87.position -=
new Vector2(2
f);
42191 Main.dust[
num551].noGravity =
true;
42193 Main.dust[
num551].customData =
this;
42194 }
42195 }
42196 }
42198 {
42200 float moveSpeed = 0.15f;
42205 {
42207 }
42209 {
42212 }
42214 {
42217 }
42218 else
42219 {
42222 }
42225 if (!((this.ai[0] += 1
f) >= 70
f))
42226 {
42227 return;
42228 }
42230 if (Main.netMode != 1)
42231 {
42234 {
42235 vector210 = Vector2.UnitY.RotatedByRandom(1.5707963705062866) *
new Vector2(5
f, 3
f);
42236 }
42237 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
vector210.X,
vector210.Y, 539, 60, 0
f, Main.myPlayer, 0
f,
whoAmI);
42238 }
42239 }
42241 {
42247 {
42249 if (Main.netMode != 1 &&
localAI[2] % 60
f == 0
f)
42250 {
42253 {
42254 vector211 = Vector2.UnitY.RotatedByRandom(1.5707963705062866) *
new Vector2(4
f, 2.5
f);
42255 }
42256 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
vector211.X,
vector211.Y, 574, 0, 0
f, Main.myPlayer, 0
f,
whoAmI);
42257 }
42258 }
42260 {
42263 {
42265 }
42266 }
42268 if (Main.netMode != 1 && (!Main.player[
target].active || Main.player[
target].dead))
42269 {
42275 }
42280 bool flag104 = Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1);
42282 if (this.ai[1] == 1
f)
42283 {
42285 {
42290 {
42298 dust87.velocity *= 3
f;
42299 Main.dust[
num560].noGravity =
true;
42300 Main.dust[
num560].scale = 2.5f;
42301 }
42302 }
42303 this.ai[3]--;
42304 if (this.ai[3] <= 0
f)
42305 {
42308 }
42309 return;
42310 }
42312 {
42315 {
42318 }
42321 }
42322 else
42323 {
42326 }
42327 if (this.ai[2] != 0
f && this.ai[3] != 0
f)
42328 {
42331 {
42339 dust87.velocity *= 3
f;
42340 Main.dust[
num563].noGravity =
true;
42341 Main.dust[
num563].scale = 2.5f;
42342 }
42343 base.Center =
new Vector2(this.ai[2] * 16
f, this.ai[3] * 16
f);
42349 {
42357 dust87.velocity *= 3
f;
42358 Main.dust[
num565].noGravity =
true;
42359 Main.dust[
num565].scale = 2.5f;
42360 }
42361 }
42362 this.ai[0]++;
42363 if (this.ai[0] >= (
float)
num555 && Main.netMode != 1)
42364 {
42366 Point
point6 =
base.Center.ToTileCoordinates();
42367 Point
point7 = Main.player[
target].Center.ToTileCoordinates();
42370 {
42376 {
42379 {
42381 break;
42382 }
42383 }
42385 {
42387 {
42390 {
42392 }
42393 }
42394 }
42395 }
42397 }
42399 {
42402 }
42403 }
42405 {
42407 if (this.ai[0] == 0
f)
42408 {
42414 }
42415 bool flag107 = Collision.CanHit(
base.Center, 1, 1, Main.player[
target].position, 1, 1);
42418 {
42420 }
42421 else
42422 {
42426 {
42428 {
42430 {
42432 }
42433 }
42434 }
42435 }
42436 if (this.ai[0] < 0
f)
42437 {
42440 if (this.ai[0] == -1
f)
42441 {
42444 {
42446 }
42450 {
42452 }
42454 {
42456 }
42461 {
42463 {
42466 {
42470 }
42471 }
42472 }
42475 {
42477 }
42479 {
42481 }
42483 {
42485 }
42487 {
42489 }
42491 }
42493 if (this.ai[1] >= 60
f && !
flag108)
42494 {
42496 }
42497 }
42498 else if (this.ai[0] == 2
f)
42499 {
42502 {
42504 }
42508 {
42509 velocity.X *= 0.96f;
42510 velocity.Y *= 0.96f;
42512 if (this.ai[1] == 20
f)
42513 {
42514 if (Main.netMode != 1)
42515 {
42517 }
42518 }
42519 else if (this.ai[1] >= 30
f)
42520 {
42522 }
42524 {
42526 {
42529 {
42533 }
42534 }
42535 }
42536 }
42537 else
42538 {
42540 }
42541 if (Main.player[
target].Center.X <
base.Center.X)
42542 {
42544 }
42545 else if (Main.player[
target].Center.X >
base.Center.X)
42546 {
42548 }
42550 }
42551 if (this.ai[0] != 1
f)
42552 {
42553 return;
42554 }
42557 {
42559 }
42561 {
42566 }
42569 {
42571 {
42574 {
42578 velocity.X -= vector219.X * 1
f;
42579 }
42580 }
42581 }
42585 {
42588 }
42589 else
42590 {
42592 {
42593 velocity.X *= -0.5f;
42596 }
42597 if (this.ai[1] > 0
f)
42598 {
42600 }
42602 {
42603 if (
base.Center.X > Main.player[
target].Center.X)
42604 {
42606 }
42607 else
42608 {
42610 }
42611 }
42613 {
42614 if (
base.Center.X > Main.player[
target].Center.X)
42615 {
42617 }
42618 else
42619 {
42621 }
42622 }
42626 {
42628 {
42630 {
42632 }
42633 else
42634 {
42636 }
42637 }
42638 else
42639 {
42640 velocity.X *= 0.99f;
42641 }
42642 }
42643 else
42644 {
42646 }
42648 }
42650 {
42653 velocity.Y *= -0.5f;
42654 }
42655 if (this.ai[2] > 0
f)
42656 {
42658 }
42659 else
42660 {
42667 {
42669 {
42671 {
42673 break;
42674 }
42675 }
42677 {
42678 break;
42679 }
42680 }
42682 {
42684 }
42686 {
42688 }
42689 }
42693 {
42695 {
42697 {
42699 }
42700 else
42701 {
42703 }
42704 }
42705 else
42706 {
42707 velocity.Y *= 0.99f;
42708 }
42709 }
42710 else
42711 {
42713 }
42714 }
42716 {
42718 {
42722 return;
42723 }
42724 if (this.ai[0] == 1
f)
42725 {
42728 this.ai[1]++;
42729 if (this.ai[1] >= 5
f)
42730 {
42733 }
42734 return;
42735 }
42736 velocity.Y += 0.2f;
42738 {
42740 }
42743 {
42744 return;
42745 }
42747 {
42750 {
42754 float speedX29 = velocity.X * 0.5f;
42755 float speedY28 = velocity.Y * 0.5f;
42758 Main.dust[
num600].noGravity =
true;
42759 Main.dust[
num600].fadeIn = 1
f;
42762 dust87.velocity *= 4
f;
42763 Main.dust[
num600].noLight =
true;
42764 }
42765 }
42767 {
42768 if (Main.rand.Next(3) < 2)
42769 {
42773 float speedX30 = velocity.X * 0.5f;
42774 float speedY29 = velocity.Y * 0.5f;
42777 Main.dust[
num603].noGravity =
true;
42780 dust87.velocity *= 0.2f;
42781 Main.dust[
num603].fadeIn = 1
f;
42782 if (Main.rand.Next(6) == 0)
42783 {
42786 dust87.velocity *= 30
f;
42787 Main.dust[
num603].noGravity =
false;
42788 Main.dust[
num603].noLight =
true;
42789 }
42790 else
42791 {
42793 }
42794 }
42795 }
42796 }
42798 {
42800 {
42804 return;
42805 }
42806 if (this.ai[0] == -1
f)
42807 {
42810 this.ai[1]++;
42811 if (this.ai[1] >= 5
f)
42812 {
42815 }
42816 return;
42817 }
42820 {
42821 return;
42822 }
42824 {
42826 velocity.X = this.ai[2];
42827 velocity.Y = this.ai[3];
42829 {
42833 float speedX31 = velocity.X * 0.5f;
42834 float speedY30 = velocity.Y * 0.5f;
42837 Main.dust[
num605].noGravity =
true;
42838 Main.dust[
num605].fadeIn = 1
f;
42841 dust87.velocity *= 4
f;
42842 Main.dust[
num605].noLight =
true;
42843 }
42844 }
42846 {
42847 if (Main.rand.Next(10 - (
int)
Math.Min(7
f, ((Vector2)(
ref velocity)).Length())) < 1)
42848 {
42852 float speedX32 = velocity.X * 0.5f;
42853 float speedY31 = velocity.Y * 0.5f;
42856 Main.dust[
num607].noGravity =
true;
42859 dust87.velocity *= 0.2f;
42860 Main.dust[
num607].fadeIn = 0.4f;
42861 if (Main.rand.Next(6) == 0)
42862 {
42865 dust87.velocity *= 5
f;
42866 Main.dust[
num607].noLight =
true;
42867 }
42868 else
42869 {
42871 }
42872 }
42873 }
42874 if (this.ai[0] >= 0
f)
42875 {
42876 this.ai[0]++;
42877 if (this.ai[0] > 60
f)
42878 {
42881 val29 =
default(Vector2);
42883 }
42884 if (this.ai[0] > 120
f)
42885 {
42887 }
42889 {
42891 }
42892 }
42893 }
42895 {
42902 bool flag109 = !(this.ai[1] >= 0
f) || !Main.npc[(
int)this.ai[0]].active;
42903 if (Main.npc[(int)this.ai[0]].type == 439)
42904 {
42905 if (Main.npc[(
int)this.ai[0]].life < Main.npc[(int)this.ai[0]].
lifeMax / 2)
42906 {
42908 }
42909 if (Main.npc[(
int)this.ai[0]].life < Main.npc[(int)this.ai[0]].
lifeMax / 4)
42910 {
42912 }
42913 }
42914 else
42915 {
42917 }
42925 if (Main.rand.Next(6) == 0)
42926 {
42927 Vector2
vector220 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
42932 dust72.noGravity = true;
42933 dust72.position = base.Center -
vector220 * (float)Main.rand.Next(10, 21) *
scale;
42934 val29 =
default(Vector2);
42935 dust72.velocity =
vector220.RotatedBy(1.5707963705062866,
val29) * 4
f;
42936 dust72.scale = 0.5f + Main.rand.NextFloat();
42937 dust72.fadeIn = 0.5f;
42938 }
42939 if (Main.rand.Next(6) == 0)
42940 {
42941 Vector2
vector221 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
42946 dust73.noGravity = true;
42948 val29 =
default(Vector2);
42949 dust73.velocity =
vector221.RotatedBy(-1.5707963705062866,
val29) * 2
f;
42950 dust73.scale = 0.5f + Main.rand.NextFloat();
42951 dust73.fadeIn = 0.5f;
42952 }
42953 if (Main.rand.Next(6) == 0)
42954 {
42955 Vector2
vector222 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
42961 dust74.velocity = Vector2.Zero;
42962 dust74.scale = 0.5f + Main.rand.NextFloat();
42963 dust74.fadeIn = 0.5f;
42964 dust74.noLight = true;
42965 }
42968 Vector2
unitY6 = Vector2.UnitY;
42970 val29 =
default(Vector2);
42972 if (this.ai[1] >=
num608)
42973 {
42975 if (Main.netMode != 1)
42976 {
42978 {
42981 val29 =
default(Vector2);
42984 }
42985 }
42986 }
42988 {
42991 }
42992 }
42994 {
42998 bool flag4 =
false;
43011 bool flag6 =
false;
43015 {
43026 {
43028 }
43030 Vector2
vector226 = base.BottomLeft +
new Vector2(0
f, -12
f);
43034 Color
color =
new Color(222, 108, 48) * 0.7f;
43039 {
43040 if (Main.rand.Next(2) != 0)
43041 {
43048 {
43049 dust75.position = base.Bottom + Utils.RandomVector2(Main.rand, -6
f, 6
f);
43050 }
43051 dust75.color =
color;
43052 dust75.scale = 0.8f;
43053 dust75.velocity.Y +=
num629;
43055 }
43057 }
43060 if (this.ai[0] < 0
f)
43061 {
43063 }
43064 if (this.ai[0] > 0
f)
43065 {
43068 this.ai[0]++;
43069 if (this.ai[0] >= 135
f)
43070 {
43071 this.ai[0] = -300
f;
43073 }
43075 Vector2
vector229 = base.Center + Vector2.UnitX * (float)
direction * 50
f - Vector2.UnitY * 6
f;
43076 if (this.ai[0] == 54
f && Main.netMode != 1)
43077 {
43081 {
43084 while (
num631 < 1000 && list.Count < 3)
43085 {
43086 bool flag8 =
false;
43088 foreach (Point item in list)
43089 {
43091 {
43093 break;
43094 }
43095 }
43097 {
43098 int startY = point8.Y - 20;
43100 if (StrayMethods.CanSpawnSandstormHostile(
new Vector2((
float)
num632, (
float)(
bottomY - 15)) * 16
f, 15, 15))
43101 {
43103 }
43104 }
43106 }
43107 foreach (Point
item2 in list)
43108 {
43110 }
43111 }
43112 else
43113 {
43114 this.ai[0] = -200
f;
43116 }
43117 }
43120 if (this.ai[0] < 114
f && this.ai[0] > 0
f)
43121 {
43124 {
43127 {
43129 }
43130 }
43133 float num634 = (this.ai[0] - 54
f) / 30
f;
43135 {
43137 {
43142 {
43144 }
43147 {
43149 }
43151 {
43153 }
43155 {
43160 dust76.noLight = true;
43161 dust76.scale = 0.3f +
num634;
43162 }
43163 }
43164 }
43165 }
43167 }
43168 if (this.ai[0] == 0
f)
43169 {
43173 }
43174 }
43176 {
43178 }
43180 {
43182 {
43184 bool flag9 =
false;
43187 {
43189 }
43191 {
43194 }
43196 {
43198 }
43200 {
43203 {
43205 }
43207 {
43212 }
43213 }
43214 else
43215 {
43219 }
43221 {
43223 }
43224 }
43225 else
43226 {
43229 }
43230 }
43236 {
43238 return;
43239 }
43241 {
43243 {
43245 }
43247 {
43249 {
43251 }
43253 break;
43254 }
43255 }
43257 {
43259 {
43261 }
43263 {
43266 break;
43267 }
43268 }
43270 {
43272 {
43274 {
43276 }
43278 {
43281 break;
43282 }
43283 }
43284 }
43286 {
43289 }
43291 {
43294 {
43296 }
43297 }
43298 else
43299 {
43301 {
43303 }
43305 {
43307 }
43308 }
43310 {
43311 velocity.X = oldVelocity.X * -0.4f;
43313 {
43315 }
43317 {
43319 }
43320 }
43322 {
43323 velocity.Y = oldVelocity.Y * -0.25f;
43325 {
43327 }
43329 {
43331 }
43332 }
43334 {
43337 {
43339 }
43341 {
43343 }
43345 {
43347 }
43348 }
43350 {
43353 {
43355 }
43357 {
43359 }
43361 {
43363 }
43364 }
43366 {
43369 {
43370 velocity.Y -=
num626 * 1.25f;
43371 }
43373 {
43374 velocity.Y +=
num626 * 0.75f;
43375 }
43377 {
43379 }
43380 }
43382 {
43385 {
43386 velocity.Y +=
num626 * 1.25f;
43387 }
43389 {
43390 velocity.Y -=
num626 * 0.75f;
43391 }
43393 {
43395 }
43396 }
43397 }
43399 {
43401 {
43403 }
43405 Point
pt =
base.Center.ToTileCoordinates();
43413 {
43415 }
43417 {
43419 }
43421 {
43423 }
43425 {
43427 {
43430 {
43432 }
43434 {
43436 }
43439 }
43440 float num649 = this.ai[1];
43442 pt = (base.Center +
new Vector2(0
f, 24
f)).ToTileCoordinates();
43445 {
43447 }
43448 this.ai[1] =
flag14.ToInt();
43449 if (this.ai[2] < 30
f)
43450 {
43451 this.ai[2]++;
43452 }
43454 {
43459 {
43461 }
43463 {
43465 }
43467 {
43469 }
43471 {
43473 }
43478 pt =
vec4.ToTileCoordinates();
43482 {
43483 flag15 = tileSafely7.liquid > 0;
43484 }
43486 if (Main.remixWorld)
43487 {
43489 }
43491 {
43493 {
43496 }
43500 }
43501 }
43502 else
43503 {
43505 {
43509 }
43511 {
43516 }
43520 {
43521 velocity.X *= 0.95f;
43522 }
43524 {
43526 }
43527 else
43528 {
43530 }
43533 if (this.ai[0] == -1
f)
43534 {
43537 {
43539 }
43540 }
43541 else
43542 {
43545 {
43547 }
43548 }
43550 {
43551 velocity.Y *= 0.95f;
43552 }
43553 }
43554 }
43555 else
43556 {
43558 {
43560 {
43562 }
43566 {
43567 velocity.X *= 0.95f;
43568 }
43569 }
43570 velocity.Y += 0.3f;
43572 {
43574 }
43576 }
43579 {
43581 }
43583 {
43585 }
43586 }
43588 {
43590 }
43592 {
43594 {
43595 Lighting.AddLight(
base.Center, 1.3f, 0.5f, 1.5f);
43596 }
43597 if (this.ai[1] == 0
f)
43598 {
43599 if (this.ai[0] > 0
f)
43600 {
43601 this.ai[0]--;
43602 }
43603 if (this.ai[0] != 0
f)
43604 {
43605 return;
43606 }
43610 {
43613 xLeftEnd.X += 2;
43614 xRightEnd.X -= 2;
43619 if (Main.netMode != 1)
43620 {
43622 }
43623 }
43624 }
43625 else if (this.ai[1] == 2
f)
43626 {
43629 if (this.ai[0] == 3
f)
43630 {
43633 {
43635 if (
nPC3.active &&
nPC3.type == 549)
43636 {
43639 nPC3.netUpdate = true;
43640 }
43641 }
43642 if (Main.netMode != 1)
43643 {
43645 }
43646 }
43647 this.ai[0]++;
43649 if (this.ai[0] <= 120
f)
43650 {
43651 float num658 = this.ai[0] / 120
f;
43653 }
43654 else
43655 {
43657 }
43660 {
43662 }
43663 if (this.ai[0] >= 600
f)
43664 {
43670 }
43671 Vector2
vector236 = base.Center +
new Vector2(0
f, -20
f);
43673 if (this.ai[0] >= 60
f)
43674 {
43676 }
43677 if (this.ai[0] >= 120
f)
43678 {
43680 }
43681 if (this.ai[0] >= 180
f)
43682 {
43684 }
43685 if (this.ai[0] >= 240
f)
43686 {
43688 }
43689 if (this.ai[0] >= 540
f)
43690 {
43692 }
43694 {
43695 if (!(Main.rand.NextFloat() <
num659))
43696 {
43697 float num661 = Main.rand.NextFloat() * ((float)
Math.PI * 2
f);
43698 float num662 = Main.rand.NextFloat();
43704 dust77.scale = 0.9f;
43705 dust77.fadeIn = 1.15f +
num662 * 0.3f;
43707 dust77.noGravity = true;
43708 dust77.noLight = true;
43709 }
43710 }
43711 if (this.ai[0] == 100
f || this.ai[0] == 160
f || this.ai[0] == 220
f || this.ai[0] == 280
f || this.ai[0] == 340
f || this.ai[0] == 370
f || this.ai[0] == 400
f || this.ai[0] == 430
f || this.ai[0] == 460
f || this.ai[0] == 500
f || this.ai[0] == 520
f || this.ai[0] == 540
f)
43712 {
43713 float num663 = Main.rand.NextFloat() * ((float)
Math.PI * 2
f);
43716 {
43718 float num667 = Main.rand.NextFloat();
43719 Vector2
vector239 = base.Center +
new Vector2(0
f, -20
f) +
num666.ToRotationVector2() * (810
f - this.ai[0]);
43724 dust78.scale = 0.9f;
43725 dust78.fadeIn = 1.15f +
num667 * 0.3f;
43726 dust78.color =
new Color(1
f, 1
f, 1
f, 0
f);
43727 dust78.noGravity = true;
43728 dust78.noLight = true;
43729 }
43730 }
43731 }
43732 else
43733 {
43734 if (this.ai[1] != 1
f)
43735 {
43736 return;
43737 }
43740 if (this.ai[0] == 0
f)
43741 {
43743 {
43745 if (
nPC4.active &&
nPC4.type == 549)
43746 {
43749 nPC4.netUpdate = true;
43750 }
43751 }
43752 if (Main.netMode != 1)
43753 {
43756 }
43757 }
43758 this.ai[0]++;
43761 {
43763 }
43765 if (this.ai[0] <
num671)
43766 {
43768 }
43769 if (this.ai[0] >=
num671)
43770 {
43773 {
43775 }
43776 }
43779 if (this.ai[0] >= 60
f)
43780 {
43782 }
43783 if (this.ai[0] >= 120
f)
43784 {
43786 }
43787 if (this.ai[0] >= 180
f)
43788 {
43790 }
43791 if (this.ai[0] >= 240
f)
43792 {
43794 }
43795 if (this.ai[0] >= 300
f)
43796 {
43798 }
43799 if (this.ai[0] >= 360
f)
43800 {
43802 }
43803 if (this.ai[0] >= 420
f)
43804 {
43806 }
43807 if (this.ai[0] >= 450
f)
43808 {
43810 }
43812 {
43813 if (!(Main.rand.NextFloat() <
num672))
43814 {
43815 float num674 = Main.rand.NextFloat() * ((float)
Math.PI * 2
f);
43816 float num675 = Main.rand.NextFloat();
43818 Vector2
vector243 = (
num674 - (float)
Math.PI / 2
f - (
float)Math.PI / 8
f).ToRotationVector2() * (12
f + 9
f * Main.rand.NextFloat() + 4
f *
num675);
43822 dust79.scale = 0.8f;
43823 dust79.fadeIn = 0.95f +
num675 * 0.3f;
43824 dust79.noGravity = true;
43825 }
43826 }
43827 if (this.ai[0] >= 600
f)
43828 {
43830 if (!Main.dedServ)
43831 {
43835 }
43840 }
43841 }
43842 }
43844 {
43846 {
43847 Lighting.AddLight(
base.Center, 0.5f, 0.1f, 0.3f);
43848 }
43849 if (this.ai[1] == 0
f)
43850 {
43852 {
43855 }
43857 {
43860 {
43862 }
43863 }
43865 {
43866 this.ai[0]++;
43867 }
43869 {
43871 {
43873 }
43876 {
43879 {
43881 }
43882 }
43883 }
43886 {
43888 }
43889 if (Main.netMode != 1 &&
localAI[0] >= 180
f)
43890 {
43892 {
43894 return;
43895 }
43899 }
43900 }
43901 else if (this.ai[1] == 1
f)
43902 {
43903 this.ai[0]++;
43907 {
43909 }
43912 {
43913 activeSound2.Volume =
scale;
43914 }
43915 if (this.ai[0] >= 550
f)
43916 {
43922 }
43923 }
43924 }
43926 {
43928 }
43930 {
43932 }
43934 {
43936 }
43938 {
43940 }
43942 {
43944 }
43946 {
43948 }
43950 {
43952 }
43954 {
43956 }
43958 {
43960 }
43962 {
43964 }
43966 {
43968 }
43970 {
43972 }
43974 {
43976 }
43978 {
43980 }
43982 {
43984 }
43986 {
43988 }
43990 {
43992 }
43994 {
43996 }
43998 {
44000 }
44001 }
Definition ActiveSound.cs:8
static ? ActiveSound GetActiveSound(SlotId slotId)
Definition SoundEngine.cs:237
static SlotId PlayTrackedSound(in SoundStyle style, Vector2? position=null)
Definition SoundEngine.cs:225
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
Definition SoundEngine.cs:147
Definition SoundEngine.cs:14
static Dictionary< int, TileEntity > ByID
Definition TileEntity.cs:20
Definition TileEntity.cs:13
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
Definition Entity.cs:57
int direction
Definition Entity.cs:41
Vector2 DirectionFrom(Vector2 Source)
Definition Entity.cs:298
Vector2 oldPosition
Definition Entity.cs:35
Vector2 Center
Definition Entity.cs:70
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
Vector2 Bottom
Definition Entity.cs:170
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
float Distance(Vector2 Other)
Definition Entity.cs:275
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
Vector2 oldVelocity
Definition Entity.cs:37
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
Vector2 DirectionTo(Vector2 Destination)
Definition Entity.cs:289
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
Definition Entity.cs:21
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static void TabletDestroyed()
Definition CultistRitual.cs:56
static bool CheckFloor(Vector2 Center, out Point[] spawnPoints)
Definition CultistRitual.cs:93
Definition CultistRitual.cs:8
static void ReportLoss()
Definition DD2Event.cs:482
static int LaneSpawnRate
Definition DD2Event.cs:35
static void SpawnMonsterFromGate(Vector2 gateBottom)
Definition DD2Event.cs:527
static void FindArenaHitbox()
Definition DD2Event.cs:771
static bool EnemySpawningIsOnHold
Definition DD2Event.cs:87
static void StopInvasion(bool win=false)
Definition DD2Event.cs:269
Definition DD2Event.cs:16
static void RequestLight(float light, Vector2 spot)
Definition MoonlordDeathDrama.cs:385
static void AddExplosion(Vector2 spot)
Definition MoonlordDeathDrama.cs:379
Definition MoonlordDeathDrama.cs:10
static void ProtectSpot(int x, int y)
Definition FixExploitManEaters.cs:14
Definition FixExploitManEaters.cs:6
static int Find(int x, int y)
Definition TETrainingDummy.cs:157
Definition TETrainingDummy.cs:9
static FilterManager Scene
Definition Filters.cs:5
static readonly SoundStyle NPCDeath58
Definition SoundID.cs:659
static readonly SoundStyle DD2_WinScene
Definition SoundID.cs:199
static readonly SoundStyle Item5
Definition SoundID.cs:687
static readonly SoundStyle DD2_EtherianPortalIdleLoop
Definition SoundID.cs:189
static readonly SoundStyle Item17
Definition SoundID.cs:711
static readonly SoundStyle Item14
Definition SoundID.cs:705
static readonly SoundStyle NPCHit4
Definition SoundID.cs:435
static readonly SoundStyle Item8
Definition SoundID.cs:693
static readonly SoundStyle NPCHit15
Definition SoundID.cs:457
static readonly SoundStyle NPCDeath61
Definition SoundID.cs:665
static readonly SoundStyle Item12
Definition SoundID.cs:701
static readonly SoundStyle NPCDeath3
Definition SoundID.cs:549
static readonly SoundStyle Item39
Definition SoundID.cs:755
static readonly SoundStyle DD2_EtherianPortalOpen
Definition SoundID.cs:191
static readonly SoundStyle Item34
Definition SoundID.cs:745
static readonly SoundStyle NPCHit17
Definition SoundID.cs:461
static readonly SoundStyle NPCHit16
Definition SoundID.cs:459
static bool[] HardenedSand
Definition TileID.cs:33
static bool[] Sand
Definition TileID.cs:31
static bool[] Sandstone
Definition TileID.cs:35
static bool[] Platforms
Definition TileID.cs:219
Vector2 netOffset
Definition NPC.cs:502
void AI_114_Dragonflies()
Definition NPC.cs:49805
void AI_117_BloodNautilus()
Definition NPC.cs:48795
void AI_026_Unicorns()
Definition NPC.cs:66382
int timeLeft
Definition NPC.cs:1017
float GetMyBalance()
Definition NPC.cs:13190
void HealEffect(int healAmount, bool broadcast=true)
Definition NPC.cs:82868
int netSpam
Definition NPC.cs:466
void AI_003_Fighters()
Definition NPC.cs:59421
int defense
How resistant to damage this NPC is. The List of NPCs wiki pagecan be useful for finding appropriat...
Definition NPC.cs:1033
void AI_110_Betsy()
Definition NPC.cs:65732
int damage
The amount of contact damage this NPC deals. Changing this WILL NOT change the amount of damage done...
Definition NPC.cs:1027
static int CountNPCS(int Type)
Returns the number of active NPC in the world of the given NPC type (F:Terraria.NPC....
Definition NPC.cs:106585
float[] localAI
Acts like F:Terraria.NPC.ai, but does not sync to the server. Many vanilla T:Terraria....
Definition NPC.cs:1003
int spriteDirection
Definition NPC.cs:1143
float Opacity
Definition NPC.cs:1517
bool confused
Definition NPC.cs:692
void AI_107_ImprovedWalkers()
Definition NPC.cs:67051
void DiscourageDespawn(int despawnTime)
Definition NPC.cs:2208
static int ShieldStrengthTowerNebula
Definition NPC.cs:928
void EncourageDespawn(int despawnTime)
Definition NPC.cs:2199
void AI_045_Golem()
Definition NPC.cs:14377
int aiAction
Definition NPC.cs:1005
void AI_001_Slimes()
Definition NPC.cs:64728
static int ShieldStrengthTowerSolar
Definition NPC.cs:924
void AI_108_DivingFlyer()
Definition NPC.cs:70432
bool reflectsProjectiles
Definition NPC.cs:1213
int lifeMax
The maximum life of this NPC.
Definition NPC.cs:1077
static int crimsonBoss
Definition NPC.cs:590
void AI_109_DarkMage()
Definition NPC.cs:71045
float gfxOffY
An offset from the actual position of the npc that will be added to the draw position....
Definition NPC.cs:549
void AI_120_HallowBoss()
Definition NPC.cs:46942
void TargetClosest(bool faceTarget=true)
Definition NPC.cs:83247
int aiStyle
Selects which vanilla code to use for the AI method. Vanilla NPC AI styles are enumerated in the T:Te...
Definition NPC.cs:1013
static readonly int[,] MoonLordAttacksArray2
Definition NPC.cs:446
static int FindFirstNPC(int Type)
Returns the index within F:Terraria.Main.npc of the the first active NPC in the world of the given NP...
Definition NPC.cs:106632
Rectangle getRect()
Definition NPC.cs:106798
bool hide
Indicates that this NPC is drawn at a specific layer in the render order. Must use in conjunction wit...
Definition NPC.cs:1098
void GetShimmered()
Definition NPC.cs:108508
void AI_111_DD2LightningBug()
Definition NPC.cs:71512
void AI_112_FairyCritter()
Definition NPC.cs:50288
void AI_87_BigMimic_FireStuffCannonBurst()
Definition NPC.cs:45379
bool dontTakeDamageFromHostiles
Definition NPC.cs:718
bool noGravity
If true, the npc will not be affected by gravity. Demon Eyes and other floating npc use this....
Definition NPC.cs:1122
void TargetClosest_WOF(bool faceTarget=true)
Definition NPC.cs:83263
int defDefense
Stores the value of F:Terraria.NPC.defense at the end of SetDefaults. Useful for scaling defense in A...
Definition NPC.cs:1043
void PopAllAttachedProjectilesAndTakeDamageForThem()
Definition NPC.cs:13798
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
Definition NPC.cs:997
Rectangle targetRect
Definition NPC.cs:1079
void AI_002_FloatingEye()
Definition NPC.cs:55518
float knockBackResist
How much of the knockback it receives will actually apply. 1f: full knockback; 0f: no knockback....
Definition NPC.cs:1110
bool dontTakeDamage
Definition NPC.cs:1160
static int ShieldStrengthTowerStardust
Definition NPC.cs:930
void AI_047_GolemFist()
Definition NPC.cs:14029
bool friendly
Indicates that an NPC is friendly to players. If true, a player won't damage the NPC and the NPC won'...
Definition NPC.cs:1197
void AI_007_TownEntities()
Definition NPC.cs:56255
static int ShieldStrengthTowerVortex
Definition NPC.cs:926
float stepSpeed
Has nothing to do with the speed that this NPC travels, that is dictated by AI code adjusting F:Terra...
Definition NPC.cs:554
float value
How many copper coins the NPC will drop when killed (100 copper coins = 1 silver coin etc....
Definition NPC.cs:1156
static bool IsMechQueenUp
Definition NPC.cs:1541
void AI_065_Butterflies()
Definition NPC.cs:45500
float scale
Makes the NPC bigger or smaller. Bigger than 1f is bigger. Defaults to 1f.
Definition NPC.cs:1104
void AI_119_Dandelion()
Definition NPC.cs:48614
bool collideX
Definition NPC.cs:1134
bool collideY
Definition NPC.cs:1136
static bool AnyNPCs(int Type)
Returns true if there are any active NPC in the world of the given NPC type (F:Terraria....
Definition NPC.cs:106615
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
Definition NPC.cs:990
void AI_069_DukeFishron()
Definition NPC.cs:51255
void AI_124_ElderSlimeChest()
Definition NPC.cs:44003
void AI_121_QueenSlime()
Definition NPC.cs:45955
int GetAttackDamage_LerpBetweenFinalValues(float normalDamage, float expertDamage)
Definition NPC.cs:1881
int alpha
0 is opaque, and 255 is transparent. Note that this is the opposite of how alpha is typically express...
Definition NPC.cs:1092
Color color
Definition NPC.cs:1085
IEntitySource GetSpawnSourceForProjectileNPC()
Definition NPC.cs:107563
float rotation
Definition NPC.cs:1116
void AI_122_PirateGhost()
Definition NPC.cs:45421
bool AI_AttemptToFindTeleportSpot(ref Vector2 chosenTile, int targetTileX, int targetTileY, int rangeFromTargetTile=20, int telefragPreventionDistanceInTiles=5, int solidTileCheckFluff=1, bool solidTileCheckCentered=false, bool teleportInAir=false)
Definition NPC.cs:13811
void AI_000_TransformBoundNPC(int playerID, int npcType)
Definition NPC.cs:45489
SoundStyle? HitSound
The sound that plays when this npc is hit. Set this to an existing T:Terraria.ID.SoundID entry or ass...
Definition NPC.cs:1059
NPC()
Definition NPC.cs:112503
double frameCounter
Definition NPC.cs:1081
void AI_125_ClumsySlimeBalloon()
Definition NPC.cs:44008
IEntitySource GetSpawnSourceForNPCFromNPCAI()
Definition NPC.cs:107568
static int NewNPC(IEntitySource source, int X, int Y, int Type, int Start=0, float ai0=0f, float ai1=0f, float ai2=0f, float ai3=0f, int Target=255)
Spawns an NPC into the game world with the given type. This method should not be called on multipla...
Definition NPC.cs:91239
void AI_084_LunaticCultist()
Definition NPC.cs:68990
void AI_116_WaterStriders()
Definition NPC.cs:49579
bool noTileCollide
If true, the npc does not collide with tiles, making the npc pass through tiles freely....
Definition NPC.cs:1128
int defDamage
Stores the value of F:Terraria.NPC.damage at the end of SetDefaults. Useful for scaling damage in AI ...
Definition NPC.cs:1038
void AI_037_Destroyer()
Definition NPC.cs:52583
int GetAttackDamage_ScaledByStrength(float normalDamage)
Definition NPC.cs:1866
void AI_113_WindyBalloon()
Definition NPC.cs:50061
void checkDead()
Definition NPC.cs:83653
int GetAttackDamage_ForProjectiles(float normalDamage, float expertDamage)
Definition NPC.cs:1891
void AI_118_Seahorses()
Definition NPC.cs:48722
bool justHit
Definition NPC.cs:1015
void SpawnStardustMark_StardustTower()
Definition NPC.cs:44155
static bool LunarApocalypseIsUp
Definition NPC.cs:944
void AI_115_LadyBugs()
Definition NPC.cs:49645
static int mechQueen
Definition NPC.cs:1223
void ReflectProjectiles(Rectangle myRect)
Definition NPC.cs:71822
static int golemBoss
Definition NPC.cs:586
void Transform(int newType)
Definition NPC.cs:91590
short releaseOwner
Identifies the player who released this NPC into the world. Used mainly for released critters....
Definition NPC.cs:514
static readonly int[,,,] MoonLordAttacksArray
Definition NPC.cs:444
int life
The current life of the NPC. Automatically set to the value of F:Terraria.NPC.lifeMax at the end of S...
Definition NPC.cs:1072
IEntitySource GetSpawnSource_ForProjectile()
Definition NPC.cs:107558
static bool[] npcsFoundForCheckActive
Definition NPC.cs:966
bool NPCCanStickToWalls()
Definition NPC.cs:59382
int soundDelay
Definition NPC.cs:974
int FindClosestPlayer()
Definition NPC.cs:82893
static IEntitySource GetSpawnSourceForNaturalSpawn()
Definition NPC.cs:107538
SoundStyle? DeathSound
The sound that plays when this npc dies. Set this to an existing T:Terraria.ID.SoundID entry or assig...
Definition NPC.cs:1067
void AI_005_EaterOfSouls()
Definition NPC.cs:53130
static int brainOfGravity
Definition NPC.cs:1225
static int activeTime
Definition NPC.cs:637
void AI_006_Worms()
Definition NPC.cs:54006
int realLife
Stores the index (the F:Terraria.Entity.whoAmI) of a single NPC. This NPC will then share a health po...
Definition NPC.cs:604
int directionY
Definition NPC.cs:983
void SimpleFlyMovement(Vector2 desiredVelocity, float moveSpeed)
Definition NPC.cs:82824
static int GetBrainOfCthuluCreepersCount()
Definition NPC.cs:53975
bool netUpdate
Definition NPC.cs:1130
int StrikeNPCNoInteraction(int Damage, float knockBack, int hitDirection)
Definition NPC.cs:91674
int target
Definition NPC.cs:1019
static int plantBoss
Definition NPC.cs:588
void AI_123_Deerclops()
Definition NPC.cs:44403
static int[,,,] InitializeMoonLordAttacks()
Definition NPC.cs:1681
void HitEffect(int hitDirection=0, double dmg=10.0, bool? instantKill=null)
Definition NPC.cs:92191
Definition Conditions.cs:51
Definition Conditions.cs:4
Definition Searches.cs:64
static GenSearch Chain(GenSearch search, params GenCondition[] conditions)
Definition Searches.cs:154
static bool Find(Point origin, GenSearch search, out Point result)
Definition WorldUtils.cs:30
Definition WorldUtils.cs:7
Definition Achievement.cs:7